[whatwg] <canvas> and ImageData

Anne van Kesteren annevk at opera.com
Sun Feb 3 02:46:25 PST 2008


On Sun, 03 Feb 2008 10:43:10 +0100, Ian Hickson <ian at hixie.ch> wrote:
> On Fri, 25 Jan 2008, Oliver Hunt wrote:
>>
>> Another thing that we need is some way to determine what the device
>> pixel->css pixel ratio is.  Currently there's isn't even a real way to
>> tell that it's 1:1 -- you would have do do a fillRect(width-1, height-1,
>> 1, 1),; then getImageData(width-1, height-1, 1, 1) and see if they
>> match.  Conceivably you could do this multiple times to estimate the
>> ratio, but it would be non-trivial.
>
> Why would you need that data?

The moment people start using getImageData() as storage mechanism (which  
they will if browsers do not fix their data: image origin stuff) you'll  
have a problem with this if the application is accessed through different  
devices that have different ratios. I suspect though that given that  
Firefox has a 1:1 ratio sites will simply rely on that...


-- 
Anne van Kesteren
<http://annevankesteren.nl/>
<http://www.opera.com/>



More information about the whatwg mailing list