SmileyChris / easy-thumbnails

Easy thumbnails for Django
http://easy-thumbnails.readthedocs.org/
BSD 3-Clause "New" or "Revised" License
1.39k stars 319 forks source link

Allow greater control over save_pil_image options #583

Closed DrMeers closed 2 years ago

DrMeers commented 3 years ago

e.g. when generating a .webp thumbnail, I'd like to pass method=6 to Image.save via save_pil_image's **options, however engine only passes a few (other) specific parameters.

Currently this means saving webp thumbnails (which I'm doing via a custom namer which checks if the alias contained webp and passes that as the extension, btw, a bit of a hack...) generate images about 4x larger file size than the (slower-but-better) method=6 equivalents.

I can't see any way to fix this apart from forking and modifying the codebase, or am I missing something?

DrMeers commented 3 years ago

Happy to create a PR for this.

We could:

It might be worth adding a cleaner way of forcing which format you want to save the thumbnail in rather than my namer hack described above too.

DrMeers commented 2 years ago

@SmileyChris am I missing anything with respect to there being no way to set which format the thumbnails should be saved in except for hacking the namer?

Also any feedback/preference on the PR options above?

SmileyChris commented 2 years ago

Released in v2.8.1