-
Notifications
You must be signed in to change notification settings - Fork 319
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
Do not generate thumbnail for image smaller than alias sizes #558
Comments
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 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 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 !
The text was updated successfully, but these errors were encountered: