Assistance Needed: Using ZBar with AWS Lambda (Python 3.12) #314
aditya-wns
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi Team,
I hope you're doing well.
I’m currently working on a serverless solution using AWS Lambda with Python 3.12 to extract barcodes from JPEG images. As part of this, I’m attempting to use the zbarimg CLI tool within a Lambda layer.
Use Case:
The goal is to pass JPEG images to zbarimg and retrieve the barcode data via a Lambda function.
Setup Details:
Environment: Amazon Linux 2 (Cloud9 used for building)
Tool: zbarimg built from source
Lambda Layer Structure:
/opt/
├── bin/zbarimg
├── lib/
├── libzbar.so
├── libjpeg.so
Commands used to build:
git clone https://github.com/mchehab/zbar.git
autoreconf -vfi
./configure --prefix=/tmp/zbar-install --without-qt --without-gtk --without-python --without-x
make && make install
I’ve ensured that libjpeg.so is included in the layer under /opt/lib.
Issue:
When invoking the Lambda function with:
subprocess.run(["/opt/bin/zbarimg", "--raw", "/tmp/test_j.jpeg"])
I receive the following error:
error while loading shared libraries: libMagickWand-6.Q16.so.6: cannot open shared object file: No such file or directory
Thank you for your time and support. I appreciate any insights or recommendations you can provide.
Best regards,
Aditya Takawale
Beta Was this translation helpful? Give feedback.
All reactions