Is there a way to use the built in image field and have the image downloaded be dynamic?
I have a module that includes an optional image field. The images chosen when used are a webp file type so they are optimized for websites. The problem is that I need a way to dynamically serve different sized versions of the image based on the screen size. For example, a source image is 2,358 x 1,762 px however we're only rendering the image as 825 X 624 px. And then when on mobile, the image is rendered even smaller than that.
I would like to dynamically serve different sizes of the image based on the screen size. This could be done fairly easily if the image were static, but this is part of a module that needs to be able to take any image in our Hubspot files (selected by the user when populating the page from the template) and dynamically serve different sizes.
Is there any built in way to accomplish this? (Before I get into ripping apart the selected src URL and rebuilding new URLs based on screen size)
We use a picture module where the user can select different images for desktop, tablet, and mobile. If no image is set for tablet or mobile, we will use the desktop picture for those devices.
We use a picture module where the user can select different images for desktop, tablet, and mobile. If no image is set for tablet or mobile, we will use the desktop picture for those devices.