SmileyChris / easy-thumbnails

Easy thumbnails for Django
http://easy-thumbnails.readthedocs.org/
BSD 3-Clause "New" or "Revised" License
1.37k stars 312 forks source link

easy-thumbnails 2.8 removed support for high resolution images #584

Closed bmihelac closed 1 year ago

bmihelac commented 2 years ago

In easy-thumbnails 2.8 support for high resolution images (THUMBNAIL_HIGH_RESOLUTION and THUMBNAIL_HIGHRES_INFIX settings) and I believe HIGH_RESOLUTION argument for thumbnail tag has also been removed.

References: https://github.com/SmileyChris/easy-thumbnails/pull/560/commits/eab17ada81aba72fc7bf694a577c420fc0b3bad2 https://github.com/SmileyChris/easy-thumbnails/pull/560/commits

easy-thumbnails warns if settings above are used, which is great:

../.venv/lib/python3.7/site-packages/easy_thumbnails/conf.py:24
  /.venv/lib/python3.7/site-packages/easy_thumbnails/conf.py:24: DeprecationWarning: THUMBNAIL_HIGH_RESOLUTION is unused and now obsolete.
    warnings.warn("THUMBNAIL_HIGH_RESOLUTION is unused and now obsolete.", DeprecationWarning)

However I believe it should be marked as breaking change, and throw ImproperlyConfiguredError if this 2 settings are still used. The reason is that following snippet would yield no result in 2.8, which gives broken images, where used:

{% load thumbnail %}
{% thumbnail image size HIGH_RESOLUTION as thumb %} 
{{ thumb.high_resolution.url }}
jrief commented 2 years ago

ups, it should have been marked in the Changelog.

bmihelac commented 2 years ago

it also looks that HIGH_RESOLUTION should be removed here:

https://github.com/SmileyChris/easy-thumbnails/blob/5fac2f7b3a89cf51e7b7cf6c6264d4eef0db59b6/easy_thumbnails/templatetags/thumbnail.py#L20

SmileyChris commented 2 years ago

@bmihelac I agree, it probably should be treated more severely. If you've got time for a PR to implement this and clean up that vestigial code, it'd be appreciated.

bmihelac commented 2 years ago

This was not the fastest pull request, but here it is :) Let me know if you think anything else is needed.