You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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?
The text was updated successfully, but these errors were encountered: