In 2014, when Retina displays where a new thing and the W3C did not provide any standardized method to handle images on displays with a pixel ratio of more than one, we had to fall back to a sort of hack, in order to render high resolution images. This included a JavaScript snippet looking for an image in high resolution, and if available serving that.
Fortunately HTML and CSS have evolved and this hack isn't required anymore. Instead we can use the srcset and sizes attributes inside our <img ...>. Other solutions are available though the <picture>-element and CSS media-queries.
I therefore will remove support for the configuration directives THUMBNAIL_HIGH_RESOLUTION and THUMBNAIL_HIGHRES_INFIX, since creating thumbnails can be handled with the means provided by the browsers themselves. For this purpose, I often use this Django snippet in my templates:
In 2014, when Retina displays where a new thing and the W3C did not provide any standardized method to handle images on displays with a pixel ratio of more than one, we had to fall back to a sort of hack, in order to render high resolution images. This included a JavaScript snippet looking for an image in high resolution, and if available serving that.
Fortunately HTML and CSS have evolved and this hack isn't required anymore. Instead we can use the
srcset
andsizes
attributes inside our<img ...>
. Other solutions are available though the<picture>
-element and CSS media-queries.I therefore will remove support for the configuration directives
THUMBNAIL_HIGH_RESOLUTION
andTHUMBNAIL_HIGHRES_INFIX
, since creating thumbnails can be handled with the means provided by the browsers themselves. For this purpose, I often use this Django snippet in my templates:This solution is faster than the
retina.js
-Hack and more importantly, it follows the HTML standard.Are the any objections for removing this legacy code, which I added in 2014?