W3C home > Mailing lists > Public > whatwg@whatwg.org > July 2009

[whatwg] Canvas context.drawImage clarification

From: Oliver Hunt <oliver@apple.com>
Date: Thu, 9 Jul 2009 16:11:14 -0700
Message-ID: <09273A03-2184-4399-B3C2-F355148CC127@apple.com>
> I'd like to make a passionate plea that the spec say  
> "implementations must
> support negative widths and negative heights and draw the image  
> backward
> effectively flipping the result".

We'd need to be fairly sure that such a change would not break  
existing content -- this is a change that would result in  
substantially different rendering in some scenarios.

> Also, I'd like to suggest that a widths and heights of 0 for source  
> should be
> valid as well as rectangles outside of the source also be valid and  
> that this
> part of the spec.
>
> "If the source rectangle is not entirely within the source image, or  
> if one of
> the sw or sh arguments is zero, the implementation must raise an  
> INDEX_SIZE_ERR
> exception."
>
> be changed to reflect that.
The issues of when exceptions should be thrown in the canvas API have  
been discussed repeatedly on this list, you should search the archives  
and see if there are any arguments you can make that have not already  
been made. (I note that i am also all for exceptions not being thrown  
in many of these cases)

> The next issue related to drawImage is that the spec does not  
> specify how to
> filter an image when scaling it. Should it use bi-linear  
> interpolation? Nearest
> Neighbor? Maybe that should stay implementation dependent?
Image scaling is implementation dependent everywhere else, why would  
it be spec defined in the case of canvas?

--Oliver
Received on Thursday, 9 July 2009 16:11:14 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:14 UTC