[whatwg] Little canvas toDataUrl

Lenny Domnitser ldrhcp at gmail.com
Wed Apr 26 18:04:14 PDT 2006

Hello, list.

Spec says <http://www.whatwg.org/specs/web-apps/current-work/#todataurl>:

> When trying to use types other than image/png, authors can check if
> the image was really returned in the requested format by checking to
> see if the returned string starts with the exact string
> "data:image/png" or not. If it does, the image is PNG, and thus the
> requested type was not supported.

This should probably be ammended to starting with one of these exact
strings: "data:image/png," or "data:image/png;". This ensures that no
future content type that starts with "image/png" can break the

More information about the whatwg mailing list