This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 25646 - ImageBitmap objects should expose original dimensions
Summary: ImageBitmap objects should expose original dimensions
Status: RESOLVED WONTFIX
Alias: None
Product: WHATWG
Classification: Unclassified
Component: HTML (show other bugs)
Version: unspecified
Hardware: PC All
: P3 enhancement
Target Milestone: Needs Impl Interest
Assignee: Ian 'Hixie' Hickson
QA Contact: contributor
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-05-09 21:41 UTC by Ian 'Hixie' Hickson
Modified: 2016-03-16 17:51 UTC (History)
4 users (show)

See Also:


Attachments

Description Ian 'Hixie' Hickson 2014-05-09 21:41:39 UTC
If you're using an ImageBitmap to pan and zoom around an original image, it might be helpful to know the original dimensions and what part of the original image you are currently looking at.

Maybe:
     readonly attribute unsigned long originalFullWidth;
     readonly attribute unsigned long originalFullHeight;
     readonly attribute double originalSourceX;
     readonly attribute double originalSourceY;
     readonly attribute double originalSourceWidth;
     readonly attribute double originalSourceHeight;
Comment 1 Ian 'Hixie' Hickson 2014-05-09 21:43:04 UTC
Another option, rather than exposing the originalSource* members, is to expose the actual dictionary that was used to configure the object, as passed to the constructor. As in:

   readonly attribute ImageBitmapSettings settings;

...or some such. (Not sure if dictionaries can be exposed in this way.)
Comment 2 Justin Novosad 2014-05-16 17:20:39 UTC
Do we really need this? Isn't it trivial to set-up a promise resolve handler that adds these attributes to the ImageBitmap?
Comment 3 Ian 'Hixie' Hickson 2014-05-16 19:30:10 UTC
For background, search for "4)" in:

   http://lists.w3.org/Archives/Public/public-whatwg-archive/2014May/0069.html

This would obviously only be a convenience API, yes.
Comment 4 Anne 2016-03-16 17:51:20 UTC
Resolving WONTFIX due to lack of implementer interest.