0

I'm trying to support retina on my site, so I set up a 2x image style and a 2x responsive image style. Now the generated HTML for images looks something like:

<img
    srcset="/sites/default/files/styles/2x/public/2019-01/foobar.jpg?itok=H_4_Z44r 1926w"
    sizes="2x"
    src="/sites/default/files/2019-01/foobar.jpg"
    typeof="foaf:Image" />

This image was already uploaded to my site when I made the change to support 2x images, and I noticed that it actually copied the original image over from /sites/default/files/2019-01/ to /sites/default/files/styles/2x/public/2019-01/.

My problem now is that I'd like to update the 2x version from the authoring interface, but I can't find anywhere where I can upload my 2x version. Is this possible?

0

1 Answer 1

1

Image styles are “derivatives” - they’re automatically derived from the original image you uploaded. A UI to manipulate those derivatives wouldn’t really make sense, the whole point is that they’re generated automatically.

If you can’t change the way you’re working, as in upload the 2x version as the original, and use a 0.5x image style for desktop, and the original upload for Retina, you could always replace the generated styled image files manually via sFTP or similar. But it would become a pain quite quickly.

1
  • 1
    The approach I ended up using for my situation was to upload 2x versions of images, and create an image style using drupal/image_effects that would resize them to 50% width and height. Then created a responsive image style that uses the halved image as the 1x version and fallback image, and the original as a 2x version. Commented Feb 6, 2019 at 19:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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