Incorrect image dimensions
-
Hello Stefan, first thanks for the wonderful plugin. I investigated plugins which would resolve responsive and retina images at my site and concluded this one is optimal. However, I am having trouble with images being inconsistent dimensions.
Namely, in gallery on the page, I use several pictures from the media, which are different sizes originally. Thumbnails in gallery appear in different sizes (not consistent on different devices as well).
I have these image sizes defined from wordpress and my theme:
'150×150' => 'thumbnail' '300×300' => 'medium' '768×0' => 'medium-large' '1024×1024' => 'large' '400x250' => 'et-pb-post-main-image', '1080x675' => 'et-pb-post-main-image-fullwidth', '400x284' => 'et-pb-portfolio-image', '510x382' => 'et-pb-portfolio-module-image', '1080x9999' => 'et-pb-portfolio-image-single', '400x516' => 'et-pb-gallery-module-image-portrait'
I also defined custom sizes twice as large for the retina support (not shown). So in total, upon each uploaded image, 21 resized images are created. Now, sometimes in thumbnail gallery, wrong image sources are served to srcset and sizes combination, so instead of 400×516 image, I have in srcset among other dimensions twice the source for 400 pixels:
https://web-cetina/wp-content/uploads/2017/05/IMG_20170325_120515-400×250.jpg 400w
https://web-cetina/wp-content/uploads/2017/05/IMG_20170325_120515-400×516.jpg 400w
Browser recognizes the first one and image gets loaded in wrong aspect/size.Switching off some dimensions from being used is not an option, as I would like all images on the site to be responsive, and some are standard wordpress sizes, and some are generated by theme, therefore using theme sizes.
Any suggestions? Seems I would have to have possibility to use only certain dimensions in srcset for certain image dimensions – how to do that?
Excuse me for not providing URL, site is still in early phase, locally.
Best, L.
- The topic ‘Incorrect image dimensions’ is closed to new replies.