Skip to content

Commit

Permalink
Clarify that createImageBitmap fails with an SVG blob
Browse files Browse the repository at this point in the history
This change makes it explicit that creating an ImageBitmap from a Blob
only supports *bitmap* file formats. This behaviour is consistent with
creating an ImageBitmap from an img element, which explicitly does not
support vector graphics.

Note: Supporting vector graphics would require defining a sizing
algorithm to determine the scale of image, or to have an alternate API
that has additional size parameters. See feature request in #923.

PR: #921
  • Loading branch information
junov authored and domenic committed Mar 22, 2016
1 parent 438155d commit 0b88bf3
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -90443,9 +90443,10 @@ interface <dfn>ImageBitmapFactories</dfn> {
by the <code>Blob</code> object's <code data-x="dom-Blob-type">type</code> attribute) giving the
official type.</p></li>

<li><p>If the image data is not in a supported file format (e.g. it's not actually an image at
all), or if the image data is corrupted in some fatal way such that the image dimensions cannot
be obtained, then reject the promise with null, and abort these steps.</p></li>
<li><p>If the image data is not in a supported bitmap image file format (e.g. it's a vector
graphic or it's not an image at all), or if the image data is corrupted in some fatal way such
that the image dimensions cannot be obtained, then reject the promise with null, and abort
these steps.</p></li>

<li><p>Create a new <code>ImageBitmap</code> object.</p></li>

Expand Down

0 comments on commit 0b88bf3

Please sign in to comment.