Trouble understanding srcSet usage with this library #273
-
The docs explain you must using What is the right way to handle showing whatever image is available and also a thumbnail version for save on loading if they don't scroll through all the thumbs? if I don't know the actual width and height when zoomed in, the pan doesn't work correctly. I don't want to have to parse the image on the server side to send the size (cpu overhead), and I don't want to store the sizes in the database (network/stroage overhead), and I don't want to enforce a fixed size image (my server resizes very large images but leaves smaller images intact) am I misunderstanding how this works? width and height seem to be required if using srcset and they need to be accurate. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
That's right. To utilize the built-in responsive images with automatic resolution switching, you must populate
You can provide whatever image URL is available in the |
Beta Was this translation helpful? Give feedback.
-
I just pulled |
Beta Was this translation helpful? Give feedback.
That's right. To utilize the built-in responsive images with automatic resolution switching, you must populate
srcSet
attribute with accuratesrc
,width
, andheight
values.srcSet
is not required, but it helps optimize network bandwidth and improve user experience.You can provide whatever image URL is available in the
src
prop. In this case, the same image will be rendered as both main image and thumbnail.…