-
Notifications
You must be signed in to change notification settings - Fork 538
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
modifying Thumbor conf value on Mac OS X (RESPECT_ORIENTATION = True) #25
Comments
Also - for this scenario of proxying source images I'd (obviously) advocate for overriding Thumbor's default and preserving the orientation on EXIF - honestly cannot imagine why you wouldn't want to do that |
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
|
@mattsly thanks for the instructions. We typically recommend build this on an Amazon Linux instance (like a t2.micro or nano) because it's compiling binaries that will be executed in Lambda. Looks like we need to think about an easier way to modify the thumbor.conf file if that's the only required changes. |
How are these instructions for simply modifying the thumbor.conf file without rebuilding the entire package? Download the latest ZIP file:
Put the updated ZIP file in an S3 bucket and update the Lambda function. |
@stevemorad I tried that and it didn't work - (edit - remembering now - when I did that the zip file generated from my mac was generating an |
Couple of quick thoughts:
|
wrt #1 - that would require code changes in the lamda function - it looks like A nice update to this project would be to many/most of the Thumbor.conf variables into the Lamda environment variables to enable. |
I have the same problem. There's no easy way for thumbor to maintain the rotation in EXIF data. I got it working w/ @stevemorad 's answer. Thanks. Hope we can have an update on this issue one to make it more seemless in future. |
And btw, on @stevemorad 's answer, editing the thumbor.conf in thumbor folder didn't worked for me. I also added the RESPECT_ORIENTATION = True in another thumbor.conf inside the image_handler folder to w/c the lambda function is using. See screenshot below |
@mattsly -- the code should already be allowing thumber.conf variables to be specified with environment variables with this command: Are you saying that this does not work for RESPECT_ORIENTATION by creating a Lambda environment variable? |
@triunm -- thanks for pointing out the correct file to modify. Revised steps are here (although using Lambda environment variables is recommended if you do not want to modify the actual lambda ZIP file):
|
@stevemorad Thanks so much for pointing out that environment variables can be used to set Thumbor conf values. I found that this works for string values, but not for int values, e.g. QUALITY. I get an error when I set an environment variable with key Here is the error I'm receiving. And here is where the error originates from in PIL Any suggestions on how to work around this? Or do I have to just manually set the value in thumbor.conf as you describe above? |
@stevemorad I definitely tried using the Lamda env variables from the Lamda UI and set Possibly a typing (Boolean in this case) issue similar to what @isTravis notes above? (though I was not seeing any exceptions) |
For your RESPECT_ORIENTATION example, would you provide a direct link to an image that is not working? I tried cropping your example, but can't replicate the solution incorrectly rotating the image. |
Sorry for the delay - I was able to get |
I 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 fromdist/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: #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.
The text was updated successfully, but these errors were encountered: