0 votes
1 view
in AWS by (19.2k points)

I'm trying to create an AWS lambda function in order to create a thumbnail of my uploaded images. My script is running well locally, I followed this tutorial to deploy my function but I have a problem with the Pillow library, indeed when I'm testing my function I can see this following log :


1 Answer

0 votes
by (44.6k points)

Include libjpeg.so in your lambda package, but also some changes are required in the file. Assuming If you do this “pip install module-name -t”, do this:

cd into/your/local/lambda/package/dir

cp -L $(ldd PIL/_imaging.so|grep libjpeg|awk '{print $3}') PIL/

patchelf --set-rpath PIL PIL/_imaging.so

# zip, deploy and test the package

This script works for Pillow version 3.2.0.

Welcome to Intellipaat Community. Get your technical queries answered by top developers !