Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change createImageBitMaps's imageOrientation attributes #8687

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 19 additions & 8 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -103606,7 +103606,7 @@ typedef (<span>CanvasImageSource</span> or
<span>Blob</span> or
<span>ImageData</span>) <dfn typedef>ImageBitmapSource</dfn>;

enum <dfn enum>ImageOrientation</dfn> { "<span data-x="dom-ImageOrientation-none">none</span>", "<span data-x="dom-ImageOrientation-flipY">flipY</span>" };
enum <dfn enum>ImageOrientation</dfn> { "<span data-x="dom-ImageOrientation-none">none</span>", "<span data-x="dom-ImageOrientation-flipY">flipY</span>", "<span data-x="dom-ImageOrientation-from-image">from-image</span>" };
enum <dfn enum>PremultiplyAlpha</dfn> { "<span data-x="dom-PremultiplyAlpha-none">none</span>", "<span data-x="dom-PremultiplyAlpha-premultiply">premultiply</span>", "<span data-x="dom-PremultiplyAlpha-default">default</span>" };
enum <dfn enum>ColorSpaceConversion</dfn> { "<span data-x="dom-ColorSpaceConversion-none">none</span>", "<span data-x="dom-ColorSpaceConversion-default">default</span>" };
enum <dfn enum>ResizeQuality</dfn> { "<span data-x="dom-ResizeQuality-pixelated">pixelated</span>", "<span data-x="dom-ResizeQuality-low">low</span>", "<span data-x="dom-ResizeQuality-medium">medium</span>", "<span data-x="dom-ResizeQuality-high">high</span>" };
Expand Down Expand Up @@ -104057,15 +104057,26 @@ dictionary <dfn dictionary>ImageBitmapOptions</dfn> {
choice of scaling algorithm.</p></li>

<li>
<p>If the value of the <dfn dict-member for="ImageBitmapOptions"><code
<p>Let <var>val</var> be the value of <dfn dict-member for="ImageBitmapOptions"><code
data-x="dom-ImageBitmapOptions-imageOrientation">imageOrientation</code></dfn> member of
<var>options</var> is "<dfn enum-value for="ImageOrientation"><code
data-x="dom-ImageOrientation-flipY">flipY</code></dfn>", <var>output</var> must be flipped
vertically, disregarding any image orientation metadata of the source (such as EXIF metadata),
if any. <ref spec=EXIF></p>
<var>options</var>, and then run these substeps:</p>

<p class="note">If the value is "<dfn enum-value for="ImageOrientation"><code
data-x="dom-ImageOrientation-none">none</code></dfn>", no extra step is required.</p>
<ol>
yiyix marked this conversation as resolved.
Show resolved Hide resolved
<li><p>If <var>val</var> is "<dfn enum-value for="ImageOrientation"><code
data-x="dom-ImageOrientation-none">none</code></dfn>", then <var>output</var> must be
oriented as encoded, ignoring any image orientation metadata of the source (such as EXIF
metadata). <ref spec=EXIF></p></li>

<li><p>If <var>val</var> is "<dfn enum-value for="ImageOrientation"><code
data-x="dom-ImageOrientation-from-image">from-image</code></dfn>", then <var>output</var> must
follow the image orientation metadata of the source.</p></li>

<li><p>If <var>val</var> is "<dfn enum-value for="ImageOrientation"><code
data-x="dom-ImageOrientation-flipY">flipY</code></dfn>", then first <var>output</var> must be
modified following the image orientation metadata of the source (as with "<code
data-x="dom-ImageOrientation-from-image">from-image</code>"), and then flipped vertically.
</p></li>
</ol>
</li>

<li>
Expand Down