Open Akiat opened 4 years ago
For each thumbnail to be created, easy-thumbnails first generates a unique name using the given parameters (size, crop, upscale, etc.). It then checks if an image with that name already exists. If so, that image is used, otherwise it is generated.
There is a function which generates that name. You can override it and add your own logic. Then for instance you can generate the same name for medium
and big
images.
I hope this helps.
Thanks for your quick reply 👍
Do you have the name of this function ?
Thanks a lot, I tried to re-use the logic of the namer "alias", but thumbnail_options.get('ALIAS', '')
returns nothing.
https://github.com/SmileyChris/easy-thumbnails/blob/master/easy_thumbnails/namers.py#L30
How can I access the name of the requested alias ?
Hi and thank you for this great module.
Is there a way to not generate a new thumbnail when the alias size is greater than the original image size ?
e.g with these aliases:
If I upload an image with a size of 300x300, it will be great to only have 1 thumbnail generated (the small one), and the other which redirect on the original image when we access it via
thumbnail_url(self.media_field, 'medium')
.If it's not yet supported, do you think it can be a feasable upgrade ?
Thanks !