Closed peteburtis closed 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 .
Good call. We actually have this info stored, but it's not exposed when kind == image. I think we can fix that.
Awesome! Can't wait to use it.
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.
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 containedwidth
andheight
, 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 thekind
being set toimage
, 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.