How to scan barcode in JPEG format with zbar in Linux?

I am working on an embedded Linux system (kernel-5.10.24). Now I am trying to use zbar-0.23 to scan barcodes in JPEG format, but I don’t know how to do that.

There is an example/scan_image.c, which can scan barcodes in PNG format, but my barcodes are all in JPEG format.

So how to scan the barcodes in JPEG format with zbar? What are the interfaces in libzbar can be used to do the JPEG barcode scanning?

Asked By: wangt13


The zbarimg program uses imagemagick to read the images.

See the code here:

That deals beautifully with jpeg and a very large range of image files (unless you disabled jpeg explicitly when building imagemagick). So, I don’t know what exactly you’re doing, but it seems like a solved problem!

Answered By: sina bala
Categories: Answers Tags: , , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.