<picture>
vs img srcset
#48
-
Hello Johannes, first-off thanks for your work - I'm a fan of Reading through the features on Now Would love to hear your thoughts on this. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
First, thanks for your kind words. They mean a lot. I'll start with a little deep dive into a responsive image-serving, to better explain my decision making later on. You are right, the All of this doesn't require using the picture tag. That only comes in handy if you want to serve different sources, as in, different file types. If you are OK only serving WebP, we could add a template tag, that renders as an image tag. But if you want to serve IE or recent WebKit versions, you might want to serve AVIF and JPEG. Or you love MPEG and want to serve JPEG2000... Bottom line, we could totally add a tag for a single file type that renders as an img-tag. Maybe you could make a suggestion, on how that might look like? Anyhow, I hope this at least answes your question. Cheers, |
Beta Was this translation helpful? Give feedback.
Hi @strom-und-spiele,
First, thanks for your kind words. They mean a lot.
I'll start with a little deep dive into a responsive image-serving, to better explain my decision making later on.
You are right, the
srcset
attribute is meant to serve images of different sizes / resolution, depending on the viewport via thesizes
. Both must actually be present and they alone do what you describe as size control and art direction.All of this doesn't require using the picture tag. That only comes in handy if you want to serve different sources, as in, different file types. If you are OK only serving WebP, we could add a template tag, that renders as an image tag. But if you want to serve IE or rece…