Intermediate sizes not accounting for aspect ratio
-
I recently noticed a rendering bug on a site I’m developing, it’s caused by the
box drawn by the browser being a drastically different aspect ratio from the actual logo (when it’s not fully rendered because it’s hidden inside a collapsible).
By the looks of it, the cause is the
wp_generate_attachment_metadatahook, which fills out the sizes list for the image, but just provides the max width/height for the size. This causes my 16:9 flag SVG to breifly render as a 8.5:11 box (my images sizes have taller height due to a lot of PDF covers) until the browser downloads and reads the proper aspect ratio for the image.I’m currenly resolving this by adding a hook after the fact that simply unsets the sizes array, but I think that this should be rewritten to output the correct width/height according to the aspect ratio of the SVG.
The topic ‘Intermediate sizes not accounting for aspect ratio’ is closed to new replies.