Tell me more ×
SmugMug Stack Exchange is a question and answer site for SmugMug developers and end users. It's 100% free, no registration required.

There are approximate image sizes, it's possible to request a custom size, but.. no way to get the exact size.

I'd like to call something like images.getEXIF or images.get or images.getURLs. Give an image id/key, tell it "medium", and get back the exact dimensions (perhaps 600x200 or 600x450 or 200x450, all of which are valid as a medium). It's easier than downloading the image, which I don't need to do.

share|improve this question

3 Answers

up vote 8 down vote accepted

In our next version of the API, we plan on returning an ImageURL object that includes dimensions rather than just a URL string.

In the meantime, you can use the Height and Width of the original image to calculate what the dimensions of a given display copy will be based on the number of pixels on the longest size.

eg...

  1. If I have an original portrait image that is 2336x3504, the Medium image will be 450 pixels high.

W = 2336 x 450 / 3504 = 300

Medium = 300x450px

  1. If I have an original landscape image that is 5634x3753, the Medium image will be 600 pixels high

H = 3753 x 600 / 5634 = 400

Medium = 600x400px

share|improve this answer
1  
that's evil and borderline broken, but it's official and it's nice to know the next version (1.4?) will have it. Thanks. – tedder42 Apr 6 '12 at 2:26

How about a petition to add 'ratio' to the 1.3 API for select requests? Logic to calculate image size could then easily be made at our end... I would imagine this addition to be perhaps the simplest ever to integrate? :)

share|improve this answer

David, seems that for 100x100 and 150x150 resolutions logic that you provide does not come true. They are always squares. Am I right and are there any other exclusions of that rule ?

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.