I'm using the lovely "Imager" plugin to produce a srcset of images, however it seems to only produce one size of image, which isn't really what i was expecting!

My code is:

{% set image = entry.image.first() %}
{% set transformedImages = craft.imager.transformImage(image, [
    { width: 1370, height: 600 },
    { width: 1000 },
    { width: 800 },
    { width: 600, jpegQuality: 65 },
    { width: 400, jpegQuality: 65 }
], { position: image.focalPoint, mode: 'crop', jpegQuality: 80 }) %}

Have i missed something here?

  • 1
    What size image is being produced? How are you testing it? Are you visiting the URL with appropriately sized browser windows to trigger the different sized images? Jun 20 '16 at 16:08
  • Can you share the HTML that it's generating?
    – Brad Bell
    Jun 20 '16 at 17:21
  • 1
    @BradBell i'm an idiot, it was the chrome devtools lying to me about the real image sizes. I loaded them up into the browser and they were the right sizes. That was using them with srcset. Damn you google chrome! Damn youuuuu!
    – John
    Jun 20 '16 at 19:19

Turns out google chrome dev tools was lying to me when i hovered over the images in a srcset and told me their natural size was different to their real size. All working grand!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.