Description
When dealing with SEO (SmileyChris/easy-thumbnails#474) or when one just wants a different THUMBNAIL_NAMER (SmileyChris/easy-thumbnails#492), there seems to be no luck with the filer.
There is the ThumbnailerNameMixin
, that has it's own get_thumbnail_name()
method, where the naming is fixed, as said there "A version of Thumbnailer.get_thumbnail_name
that produces a
reproducible thumbnail name that can be converted back to the original
filename. : https://github.com/divio/django-filer/blob/006a1cfbdb5f61b6725b7675c7f9117e85b5d367/filer/utils/filer_easy_thumbnails.py#L32 That mixin is used for FilerThumbnailer
, that is then created here: https://github.com/divio/django-filer/blob/006a1cfbdb5f61b6725b7675c7f9117e85b5d367/filer/models/abstract.py#L175 . I do not really get how this all works and interacts with easy_thumbnails. But the question remains: Why does filer need to override the namer, and get back to the original from the thumbnail? Normally, it would be enough to get the thumbnails, when for example deleting a file, so no orphaned thumbs are around?
And finally, am I missing something in the docs, and setting a custom namer is already possible?
Activity
benzkji commentedon Aug 28, 2018
Ah. I guess getting to the original is needed when verifying access thumbnails of secured files/images?! Making a custom namer possible on non-protected files would be a nice one, then :)
benzkji commentedon Aug 29, 2018
It is for serving protected thumbnails. As far as I can see, it could be changed to support custom namer, needing to have a setting for the regex.
could be
It would then be in the users responsibility, to make finding the original file work, when serving protected thumbnails. Or, as an alternative, only use the filer namer when creating protected files. This is not preffered, as technically "protected" files still can be public.
Feedback welcome!
benzkji commentedon Aug 29, 2018
"Hashed only" namers would not work, but still...the alias namer is crucial for image SEO, and a real drawback if not available.
benzkji commentedon Aug 30, 2018
a quick feedback from the team would be nice, like "we wont ever support" or "sure, wait, we'll do that right now, it's so easy".
thanks in advance @yakky @stefanfoulis ?
ianare commentedon Mar 11, 2019
In order to work around this issue I've configured my nginx server to redirect all resized images to the original, but only on search engine user agent.
In this way Google always gets the full sized image, and I don't have to worry about changing image dimensions in thumbnails.
Not saying this is ideal... but seems to work well enough.
benzkji commentedon Mar 11, 2019
thanks for the insight. least but ideal - you'll get really bad scores in page speed insights, this way...this being only the first thing coming to my mind ...
ianare commentedon Apr 15, 2019
I'm getting good scores on page speed insights (96 on dekstop / 54 on mobile), the bad score on mobile is due to "Defer offscreen images" and "Eliminate render-blocking resources" which we are in the process of fixing. PageSpeed uses a mobile Chrome user agant so is not impacted by this.
Here is my nginx mapping if of some interest to others:
and then it's used as follows in the virtual host conf file:
benzkji commentedon Apr 5, 2022
how about digging this one out - @jrief ? I hate monkey patching ;-)
stale commentedon Jul 28, 2022
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 commentedon Aug 31, 2022
This will now be closed due to inactivity, but feel free to reopen it.
16 remaining items