Skip to content
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

Using postprocessor like jpegoptim or optiping? #481

Open
jhancia opened this issue Dec 27, 2018 · 1 comment
Open

Using postprocessor like jpegoptim or optiping? #481

jhancia opened this issue Dec 27, 2018 · 1 comment

Comments

@jhancia
Copy link

jhancia commented Dec 27, 2018

Thank you for this very useful package. I want to have a thumbnail generated when user uploads a file, probably using celery. I see we can set the general quality and size. Wondering if it's possible to also run the thumbnail through a postprocessor optimizer like jpegoptim or optipng? These can apparently reduce the file size by almost 50% (read about this in another package). Is this easy to do/any guidance on how to do this?

@vstoykov
Copy link
Collaborator

vstoykov commented Feb 5, 2019

This should probably be possible with custom processor, but I'm not sure what will happens if Pillow is opening optimized image and then save it to another file. Will it preserve the optimizations or thy will be loosed? These optimizers are working on file on the filesystem right? If so then using them in ImageKit can be somehow suboptimal:

  1. store the resulting image in temp file;
  2. run the optimizer;
  3. Open the resulting image and return it from the processor.

But if this is ok then why not. You can try to create custom processor for your project which will do the same, and then share the result with us ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants