---
title: "Discussion on \"How to query image dimensions from Sanity?\" | Hashnode"
description: "Discussion on \"How to query image dimensions from Sanity?\". I haven't used Sanity before, so it took me a while to figure out, how to get photos dimensions using GROQ queries. \nHere's how I've done it:\nGROQ query\nexport const query = groq`\n  *[_type == \"photo\"] {\n    image{\n      \"dimensions\": asset->metadata..."
url: "https://hashnode.com/posts/how-to-query-image-dimensions-from-sanity/6380a05a02ed71f5750f0c56"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [How to query image dimensions from Sanity?](https://blog.macieksitkowski.com/how-to-query-image-dimensions-from-sanity?utm_source=hashnode&utm_medium=feed)

I haven't used Sanity before, so it took me a while to figure out, how to get photos dimensions using GROQ queries. Here's how I've done it: GROQ query export const query = groq\` \*\[\_type == "photo"\] { image{ "dimensions": asset->metadata...

Nov 25, 2022 · 1 min read · blog.macieksitkowski.com  
Read the article

-   [#sanity](https://hashnode.com/tag/sanity)
-   [#nextjs](https://hashnode.com/tag/nextjs)
-   [#2articles1week](https://hashnode.com/tag/2articles1week)

## Written by

[Maciek Sitkowski](https://hashnode.com/@sitek94)

@sitek94 · Poland

  
[View profile](https://hashnode.com/@sitek94)

mostly frontend

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
