Skip to content

Optimize JPEGs #10

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

Closed
pableu opened this issue Oct 17, 2017 · 8 comments
Closed

Optimize JPEGs #10

pableu opened this issue Oct 17, 2017 · 8 comments

Comments

@pableu
Copy link

pableu commented Oct 17, 2017

The images created by this service can sometimes be optimized 10% or more by tools like kraken.io or mozjpeg.

I think it would be worthwile to include and enable such optimizations by default.

I see that Thumbor has built in support for jpegtran, but it's not enabeld in thumbor.conf (and the binary is probably missing).

Could you add this feature? It would make this a much more viable alternative to commercial services like imgix.

@kkopachev
Copy link

From my understanding, jpegtran is pretty much useless, since PIL engine uses same libjpeg-turbo underneath as jpegtran from libjpeg-turbo-progs does. PIL engine does not save any additional meta, if thumbor configured to strip icc (filter) and strip exif (conf variable).
However, one could use jpegtran binary from mozjpeg, which could do different scans for progressive jpegs and apply some more heuristics to huffman coding.

@stevemorad
Copy link
Contributor

We are testing a new update to support this request. Would anyone mind testing the following template and provide feedback if this is what you are looking for?
https://s3.amazonaws.com/solutions-test-reference/serverless-image-handler/latest/serverless-image-handler.template

@stevemorad
Copy link
Contributor

gifscile, imgmin, jpegtran, optipng, pngcrush, pngquant, and mozjpeg have been included in v2.2.

Would you test and verify if the latest version addresses this issue?
https://s3.amazonaws.com/solutions-reference/serverless-image-handler/latest/serverless-image-handler.template

@asaghri
Copy link

asaghri commented Jul 13, 2018

Hello,

Thank you for including all the optimizers !
Unfortunately, when I enable mozjpeg we have an error in the lambda execution :
ERROR mozjpeg path '/var/task/mozjpeg' is not accessible
Any idea on how to resolve this ?

Thank you !

@lucassena
Copy link

Hello @asaghri, how can I test theses optimizations features?

@Jno21
Copy link

Jno21 commented Feb 6, 2019

Hello,

I successfully made it work by building in a Docker image from amazonlinux but it required some changes in the yum install process and the building script ./build-s3-dist.sh.

I could share my changes if needed.

@lucassena
Copy link

Hello,

I successfully made it work by building in a Docker image from amazonlinux but it required some changes in the yum install process and the building script ./build-s3-dist.sh.

I could share my changes if needed.

Share plz?!

@leviwilson
Copy link

@lucassena I have #45 out there that has an example of a Dockerfile to build it.

It's possible it's out of date by now though. It's unclear to me how they are building the ./build-s3-dist.sh without a repeatable build (with docker build or the like).

thisismana pushed a commit to thisismana/serverless-image-handler that referenced this issue Apr 15, 2021
* Reimplemented logger and logger unit test suite to not interfere with global side effects of the other giant monolithic test suits by awslabs

* Refactored logger calls to provide usefull information and document what the provided data is about

* Refactored logger calls in image request module to provide usefull information and document what the provided data is about

* Refactored logger calls in image handler module to provide usefull information and document what the provided data is about
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants