appdotnet / api-spec

App.net API Documentation is on the web at https://developers.app.net. Source for these docs is in the new-docs branch here. Please use the issue tracker and submit pull requests! Help us build the real-time social service where users and developers come first, not advertisers.
https://developers.app.net
952 stars 99 forks source link

Provide Original Image Pixel Dimensions in the Files API #324

Closed peteburtis closed 11 years ago

peteburtis commented 11 years ago

In the Files API, when the file is an image, it would be useful to know the dimensions of the image in pixels before downloading it.

I'd propose adding a simple image_dimensions object to the File object, which contained width and height, or null if the file is not of type Image or if the image hasn't been processed yet.

I realize that this is the kind of thing that would generally go in an annotation, and that the Files API ought to be more or less file-content agnostic, but I'd note that images are already treated specially in other ways when uploaded, i.e. the derived_files thumbnails and the kind being set to image, and pragmatically, it's probably already too late to get all the clients on board with a dimensions annotation.

Among other applications, this would allow FileBase and other OS X apps that use QuickLook windows (kiwi comes to mind) to open those windows with the appropriate dimensions immediately, instead of opening them at a generic (usually much too large) size for the duration of the image download, and then resizing after the image is loaded.

kosso commented 11 years ago

As a bit of a sidenote, when I do media processing for photos and videos from bli.ms, the oembed data contains the width and height of the media, as well as the thumbnail width and height. I also provide an aspect ratio too. (though not needed).

On 26 March 2013 23:56, Pete Burtis notifications@github.com wrote:

In the Files API, when the file is an image, it would be useful to know the dimensions of the image in pixels before downloading it.

I'd propose adding a simple image_dimensions object to the File object, which contained width and height, or null if the file is not of type Image or if the image hasn't been processed yet.

I realize that this is the kind of thing that would generally go in an annotation, and that the Files API ought to be more or less file-content agnostic, but I'd note that images are already treated specially in other ways when uploaded, i.e. the derived_files thumbnails and the kind being set to image, and pragmatically, it's probably already too late to get all the clients on board.

Among other applications, this would allow FileBase and other OS X apps that use QuickLook windows (kiwi comes to mind) to open those windows with the appropriate dimensions immediately, instead of opening them at a generic (usually much too large) size for the duration of the image download, and then resizing after the image is loaded.

— Reply to this email directly or view it on GitHubhttps://github.com/appdotnet/api-spec/issues/324 .

berg commented 11 years ago

Good call. We actually have this info stored, but it's not exposed when kind == image. I think we can fix that.

peteburtis commented 11 years ago

Awesome! Can't wait to use it.

mthurman commented 11 years ago

I haven't rolled out documentation for this yet, but there is now an image_info object when you request an image. It contains width and height. I'll leave this issue open until the docs are updated.