Resurrecting an old thread...

On Mon, Jun 2, 2008 at 14:03, Nigel Tao <[email protected]> wrote:
> I would like to find out more information about the blobs that I have,
> such as the dimensions of an image (without having to first put it
> into an <img> tag, or even without allocating an unnecessary WxH
> buffer in memory). Other examples include the number of pages in a PDF
> file, or the duration of a video, or, fundamentally, is this Blob an
> image or not?
>
> I propose adding a read-only 'properties' property on Blob


On Mon, Jun 2, 2008 at 14:38, Aaron Boodman <[email protected]> wrote:
> I like mimeType, always have. I'm not so sure about the
> mimeType-specific properties, though.


On Mon, Jun 2, 2008 at 15:30, Chris Prince <[email protected]> wrote:
>> fundamentally, is this Blob an image or not?
>
> I think of it the opposite way: an Image (or File, etc) "has a" blob.
> But a blob never "is a" file / image / etc.  A blob is just a handle
> to binary data.


You're probably right in that such metadata shouldn't be a property of
the blob object itself. How about a desktop.extractMetaData(blob)
method, that would return a plain old JavaScript object of key-value
pairs. Something like {
  imageWidth: 640,
  imageHeight: 480,
  mimeType: 'image/jpeg'
}

Reply via email to