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

can I set a different file extension for specific alias? #572

Closed Takiro closed 2 years ago

Takiro commented 3 years ago

Hi, I just wondered if it is possible to set the file extension for a single alias. I currently leave the extension as is, but I need one as always as JPG. So I created an alias in the config similar to this:

THUMBNAIL_PRESERVE_EXTENSIONS = None
THUMBNAIL_ALIASES = {
    'gallery': {
        'SMALL': {'size': (1000, 1000), 'crop': 'scale'},
        'SMALL_LOW': {'size': (1000, 1000), 'crop': 'scale', 'thumbnail_extension': 'jpg'},
    },
}

I debugged the namer and it creates a name with jpg extension but the actual file will just have PNG (the extension of the original file). Is it currently possible to change the extension for an alias and I simply do something wrong?