Prismic enforcing image size

Hi

I have a slice in one of my custom types that contains an image. I understand you can add as many sizes as you want, however, what I need is to have the image placeholder BUT being able to add the image with the original size/dimensions they have been uploaded to the media section.

Currently, if I add the image to the repeatable zone image placeholder, it will default to the chosen image sizes (more specifically, to the main size or image constraints).

Anyone knows a way to just grab the original image size (width and height)?

Thanks

Hey there, welcome to the Prismic community

You can adjust the size constraints of your images fields from the Custom Type builder:

To define a full-size version of the image, leave the Width and Height fields empty; this will be automatically set up as auto x auto

Hi @Pau I don't want to adjust the size, I want to be able to upload the media and grab the original size measures rather than having to resize.

Hey there.

I understand. To do that, you need to open your Custom Type and in the size settings, you need to leave the first two fields empty. These are width and height. These empty values will allow you to add an image in its original size in the documents

1 Like

hi @Pau yes this is perfect :grinning: thank you!

Glad it helped you. Let us know if we can help you with anything else!

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.