Image field dimensions

I have multiple models and custom components which use a file type, accepting image formats. I’m using Gatbsy, and want to make use of the Gatsby Image plugin, so want to take the image process it to generate an object of type IGatsbyImageData, although this requires the original image width and height.

Is there any way of accessing this data? I’d have thought as images are uploaded to builder.io the data should exist?

Hi @edward-simpson,

You can use Builder’s Image API to access and download optimized versions of images that you’ve uploaded.

Hi Manish,

Yes, I use the Image API to generate the image urls for different widths, but that doesn’t answer my question, which is whether the original image dimensions are accessible, ideally via GraphQL

Hi @edward-simpson,

When you use Builder, it analyzes your image and determines the exact sizing of your image for all device sizes, automatically generating the optimal sizes attribute.

Unfortunately, there is no option to access original images. You can submit a feature request here Builder.io Ideas.

Only if you’re using the built in Image component, if you need to inject an image into a custom component using a file field you only get a single image URL.

I’ll submit a feature request

2 Likes