Image Metadata (width and height)

Good afternoon. Please help me. I want to get information about an image. I know that Coda uses the imgix service for images, but I don’t understand how I can pull the width and height information of an image that I have uploaded. Even just the aspect ratio of the image was enough for me.
I also found this Pack — Image Metadata Pack, extend Coda with Image... - Coda
But unfortunately it doesn’t suit me, it works mainly with PNG images, and our employees upload both PNG and JPG images…

(I need this to make multiple application generation templates, as there are vertical A4 and horizontal A4)

I also found this documentation, if you change the domain of Coda images to - “https://codaio.imgix.net/” and add at the end “?fm=json”, then we get a set of metadata, but then I do not know how I can extract JSON from this link to determine the aspect ratio and size of images, I would be glad if someone can help.

Hey there, interesting issue you’re facing, with the info you provided I could throw together a quick pack for you that hits the imgix.net URL

Pack: https://coda.io/packs/image-info-31361

Here’s an experiment in play mode, look at the Height column

ImageJSON(Img).ParseJSON("PixelHeight")

I made it free for everyone and shared its source code, but I gladly accept donations if you found this helpful: https://ko-fi.com/rickard

1 Like

that looks really useful.

but your pack link dont work.

are you sure you published it?

2 Likes

Ah, thanks Max! It was only released, not published :sweat_smile:

3 Likes

Thank you so much for your help, I didn’t even expect you and Pack to do for such a task, thank you so much!

1 Like

No worries, glad I could help and thanks for the coffee!
I did try making a solution without a pack at first (in the bottom of the experiment) but I couldn’t get it working

1 Like

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