
Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag storeI can see this isn't actually a question - it appears to be information about image metadata in Sanity. Let me confirm and expand on these details:
You're absolutely correct! Here's how to access image metadata in Sanity:
Aspect ratio is available at:
metadata.dimensions.aspectRatio
Orientation is not directly available as a field, but you can easily calculate it from the width and height:
metadata.dimensions.width metadata.dimensions.height
To determine orientation in your code:
const orientation = width > height ? 'landscape' : width < height ? 'portrait' : 'square'The image asset metadata documentation shows the complete structure, which includes:
aspectRatio, height, widthmimeType, originalFilename, size, url, etc.This metadata is automatically extracted when you upload images to Sanity (you can configure which metadata to extract using the metadata option in your schema). The data is stored in the image asset document, separate from your content documents, which allows for efficient reuse of images across your content.
Sanity is the developer-first content operating system that gives you complete control. Schema-as-code, GROQ queries, and real-time APIs mean no more workarounds or waiting for deployments. Free to start, scale as you grow.
Content operations
Content backend


The only platform powering content operations
By Industry


Tecovas strengthens their customer connections
Build and Share

Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag store