0

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?

2
  • You should pester your HW vendor for an updated BSP. 5.10 LTS is at subversion 212 now, so you are missing about 3 years of security updates on that 5.10.24 install. Or better yet, respin all this based on a less ancient 6.1, or 6.6 kernel Commented Mar 14 at 9:13
  • OK, that is a good reminder. I will chat with HW vendor on the SDK updating.
    – wangt13
    Commented Mar 14 at 23:36

1 Answer 1

1

The zbarimg program uses imagemagick to read the images.

See the code here: https://github.com/herbyme/zbar/blob/068c810f75994b61ab9edc689650d09a0fc78bf9/zbarimg/zbarimg.c#L127

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!

2
  • OK, I did notice there is a folder of zbarimg in the source code of zbar. I tried to enable its compiling by changing the Makefile, but it reported missing of some symbols. So as you answered, it depends on imagemagick. I will try that by building imagemagick firstly then build zbarimg to try. Do you know the resource requirement using zbarimg with imagemagick, if the performance is OK for a small embedded system? I will vote for your answer 2 days later.
    – wangt13
    Commented Mar 9 at 12:35
  • I just tried rebuilding zbarimg with imagemagick enabled, it worked with a barcode in JPEG format. I already voted for this answer.
    – wangt13
    Commented Mar 9 at 13:47

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .