django-cms / django-filer

File and Image Management Application for django
https://django-filer.readthedocs.io/
Other
1.73k stars 575 forks source link

ThumbnailerNameMixin.get_thumbnail_name not using quality for WebP #1292

Closed fabien-michel closed 1 year ago

fabien-michel commented 2 years ago

Hi,

I'm forcing values inside self.thumbnail_extension and self.thumbnail_transparency_extension of easy_thumbnails.files.Thumbnailer to force it to generate a WebP version of thumbnail. It works very well but the file name generated does not include the quality level as it does for JPEG.

This is caused by django-filer's ThumbnailerNameMixin.get_thumbnail_name which override file name generation and hard code condition for quality parts of filename to jpg extension: https://github.com/django-cms/django-filer/blob/ee1a72e74e8a51ff90d2c9dc3e4276ebb327af35/filer/utils/filer_easy_thumbnails.py#L48

The original easy_thumbnails get_thumbnail_name do not has this condition and only indicate quality in file name if the quality option exists:

https://github.com/SmileyChris/easy-thumbnails/blob/bc39d7ec3f4c72b000a82f7838eb3c16bcaa86c7/easy_thumbnails/options.py#L19

I suggest to have django-filer comply to what easy_thumbnails is originally doing.

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] commented 1 year ago

This will now be closed due to inactivity, but feel free to reopen it.