Hello,
Having some issues with the digital ocean version and image dimensions.
Given this query:
*[_type == "display"][_id == $id][0...1] {
"slug": slug.current,
"content": content[] {
_key, "content":
content-> {
duration,
"media": media {
type,
type == "video" => {
_type,
type,
"video": video.asset-> { url } },
type == "image" => {
_type, "image":
image {
_type, "asset":
asset-> {
"src": digitalOcean.originURL,
"width": dimensions.width,
"height": dimensions.height,
dimensions,
"alt": title,
fileName,
fileURL,
digitalOcean
}
}
}
}
}
}
}
I'm getting this response:
{
"slug": "test",
"content": [
{
"_key": "879e2e18319f",
"content": {
"duration": 10,
"media": {
"type": "image",
"_type": "asset",
"image": {
"_type": "digital-ocean-files.media",
"asset": {
"alt": null,
"digitalOcean": {
"bucket": "redacted",
"key": "store/1760006987657-45df72b5fcb1b76c-2025-10-09T10-49-47.645Z-android-chrome-512x512.png",
"originURL": "https://redacted.lon1.digitaloceanspaces.com/store/1760006987657-45df72b5fcb1b76c-2025-10-09T10-49-47.645Z-android-chrome-512x512.png",
"region": "lon1"
},
"dimensions": null,
"fileName": "2025-10-09T10-49-47.966Z-android-chrome-512x512.png",
"fileURL": "https://staging-compiled-files-respository.lon1.cdn.digitaloceanspaces.com/store/1760006987657-45df72b5fcb1b76c-2025-10-09T10-49-47.645Z-android-chrome-512x512.png",
"height": null,
"src": "https://redacted.lon1.digitaloceanspaces.com/store/1760006987657-45df72b5fcb1b76c-2025-10-09T10-49-47.645Z-android-chrome-512x512.png",
"width": null
}
}
}
}
}
]
}
This is the field (it was previously an image field, i just changed the type leaving the other options as is
defineField({
name: 'image',
type: 'digital-ocean-files.media',
title: 'Image',
options: {
collapsed: false,
hotspot: true,
},
hidden: ({ parent }) => parent?.type !== 'image',
validation: (rule) =>
rule.custom((value, context) => {
if ((context?.parent as any)?.type === 'image') {
if (!value) {
return 'Image is required when type is image'
}
}
return true
}),
}),
Should I be able to get the width and height of images uploaded to s3.
Thanks
Hello,
Having some issues with the digital ocean version and image dimensions.
Given this query:
I'm getting this response:
This is the field (it was previously an image field, i just changed the type leaving the other options as is
Should I be able to get the width and height of images uploaded to s3.
Thanks