modifying Thumbor conf value on Mac OS X (RESPECT_ORIENTATION = True)
See original GitHub issueI need to change the Thumbor to not rotate images by default by changing this config value
RESPECT_ORIENTATION = True
to avoid the case like the attached image (basically all landscape mobile photos)
(I’m befuddled why RESPECT_ORIENTATION is False by default? Why would we want Thumbor to rotate an source image w/out explicitly asking for it?)
I’m on Mac OS X (High Sierra) - checked out repo, set up Python w/ virtualenv, ran ./build-s3-dist.sh {{bucketname...actually doesn't matter}}
and all compiled well locally - then I uploaded the generated file from dist/serverless-image-handler.zip
into an s3 bucket (needed to do that rather than direct upload since > 50MB) and then uploaded from the associated Lamda.
Excited to see my images not rotated…but got an internal server error
trying to render an image and looking at CloudWatch see the following:
Unable to import module 'image_handler/lambda_function': /var/task/PIL/_imaging.so: invalid ELF header
Almost sure this is b/c I’m compiling in an environment that (OS X) that doesn’t match that of the Lamda. (@arahayrabedian apparently had more luck: https://github.com/awslabs/serverless-image-handler/issues/11 - guessing he was on Linux?)
Any hints? Do I need to spin up an EC2 Linux or use Docker?
This is a lot of pain for a 1 line change! I wish Thumbor config files be adjusted from Lamda environment variables, but I believe they’re build time so not possible.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:15 (6 by maintainers)
Top GitHub Comments
Update - was able to finally get this to work - posting a summary overview here for anyone else who is on a Mac and wants to make changes to the default Thumbor config
source/image_handler/thumbor.conf
filedocker run -v <directory with this project>:/working -it lambci/lambda:build-python2.7 bash
sudo yum-config-manager --enable epel
andalias sudo='sudo env PATH=$PATH'
)cd deployment
and./build-s3-dist.sh source-bucket-base-name
(note that you can use anything for the bucket name since the only file you care about is thedeployment/dist/serverless-image-handler.zip
file that gets generated following all of this)Sorry for the delay - I was able to get
RESPECT_ORIENTATION
to indeed work based on the Lamda env variable change only. I think I must have been testing w/ an already rotated image 🤦♂️ - closing this one out thanks for your help @stevemorad