We are transitioning over to a new forum platform. Please post new issues there. Existing threads will be dealt with here unless you choose to move them over. Visit the new forum
How should I be using density on images?
Quick question as I can't get my head around this. But how should I be using density on images? Here is a template I setup as part of an article block.
<img src="<perch:content type="image" id="image" label="Image" density="1" />" srcset="<perch:content type="image" id="image" label="Image" density="1" /> 1x, <perch:content type="image" id="image" label="Image" density="2" /> 2x" alt="<perch:content type="text" id="alt" label="Description" required="true" help="e.g. Photo of MD John Smith with his best wig on" title="true" />" />
it is supposed to create the normal image and @2x image. This would particular template allows for user to upload any sized image and not have the system resize it (like I would do with a full size image or an inline image). It is for instances like logos/graphics etc and such where you might to just upload an image at a pre-created size. However, I was still hoping to create a @2x sized image.
So for example I am uploading a ISO logo at 400x80px I would expect this to form the 2x and then the system to create a 1x version of this at 200x40px. But it only seems to create the original uploaded 400px version.
Am I missing something in my code? Or have I misunderstood how density should be used in templates.
Want to reply to this thread?Login with Perch