<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>25642</bug_id>
          
          <creation_ts>2014-05-09 21:18:19 +0000</creation_ts>
          <short_desc>createImageBitmap() options: image data orientation</short_desc>
          <delta_ts>2016-03-16 14:15:58 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WHATWG</product>
          <component>HTML</component>
          <version>unspecified</version>
          <rep_platform>Other</rep_platform>
          <op_sys>other</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>MOVED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P3</priority>
          <bug_severity>enhancement</bug_severity>
          <target_milestone>Needs Impl Interest</target_milestone>
          <dependson>25639</dependson>
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Ian &apos;Hixie&apos; Hickson">ian</reporter>
          <assigned_to name="Ian &apos;Hixie&apos; Hickson">ian</assigned_to>
          <cc>annevk</cc>
    
    <cc>ian</cc>
    
    <cc>junov</cc>
    
    <cc>kbr</cc>
    
    <cc>mike</cc>
          
          <qa_contact>contributor</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>105583</commentid>
    <comment_count>0</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2014-05-09 21:18:19 +0000</bug_when>
    <thetext>This bug proposes the following new option for createImageBitmap()&apos;s configuration dictionary (as proposed in bug 25639):

  OrientationKind orientation = &apos;unchanged&apos; // how to orient the image
    // OrientationKind:
    //   &apos;unchanged&apos; - pass the image through unmodified
    //   &apos;flipY&apos; - vertically invert the image data
    //   &apos;upright&apos; - place the top left of the image according to the metadata
    //       at the top left of the bitmap data; acts as &apos;unchanged&apos; in the
    //       absence of image orientation metadata
    //   &apos;inverted&apos; - place the top left of the image according to the metadata
    //       at the bottom left of the bitmap data; acts as &apos;flipY&apos; in the
    //       absence of image orientation metadata

See also:
   http://wiki.whatwg.org/wiki/ImageBitmap_Options
   http://lists.w3.org/Archives/Public/public-whatwg-archive/2014May/0067.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>105588</commentid>
    <comment_count>1</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2014-05-09 21:21:58 +0000</bug_when>
    <thetext>*** Bug 25507 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>105624</commentid>
    <comment_count>2</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2014-05-10 14:45:07 +0000</bug_when>
    <thetext>I think you want to align with bug 25508 here in some way.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>106016</commentid>
    <comment_count>3</comment_count>
    <who name="Kenneth Russell">kbr</who>
    <bug_when>2014-05-15 06:36:32 +0000</bug_when>
    <thetext>For the record, the WebGL working group would like to see this option in the spec.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>106062</commentid>
    <comment_count>4</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2014-05-15 18:06:26 +0000</bug_when>
    <thetext>If we&apos;re going to align with bug 25508, I guess the values would be:

   unchanged
   flipY
   autorotate
   autorotate-flipY</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>106085</commentid>
    <comment_count>5</comment_count>
    <who name="Kenneth Russell">kbr</who>
    <bug_when>2014-05-15 20:18:09 +0000</bug_when>
    <thetext>Additionally, there is desire to implement this feature on the Google Chrome team. Having it specified would make it easier to motivate adding it.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>106160</commentid>
    <comment_count>6</comment_count>
    <who name="Justin Novosad">junov</who>
    <bug_when>2014-05-16 13:22:38 +0000</bug_when>
    <thetext>FWIW, having options that respect orientation meta data here is not redundant with bug 25508 because we need a path to support orientation meta data when not going through an &lt;img&gt;. For example, when loading from a blob.

However, in cases where we are loading through an &lt;img&gt;, the behavior has to be smart and take into account any upstream orientation tweaking that may have been performed by the &lt;img&gt; decoding steps.  For example, if the image element already autorotated that data, createImageBitmap with orientation=&apos;autorotate&apos; must detect this and not &quot;autorotate&quot; a second time.

Issue: How do we handle the case where &apos;unchanged&apos; or &apos;flipY&apos; are used with an &lt;img&gt; that is autorotated? Is the image to be &apos;unchanged&apos; with respect to the pre- or post-autorotated orientation? I can&apos;t think of any use cases that would strongly require one or the other, but the behavior still need to be clearly defined. I think using the post-autorotated image would be more predictable behavior (what devs would expect), but I don&apos;t have any strong arguments to support that claim.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>106162</commentid>
    <comment_count>7</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2014-05-16 13:31:23 +0000</bug_when>
    <thetext>Align != redundant ;-)

I would expect that the parameter overrides the &lt;img&gt; attribute (acting as if the attribute was not specified). If the parameter is not given, the &lt;img&gt; attribute would be used.

That would make specifying the same a no-op and still give full control relative to the source image. I don&apos;t see a reason for stacking.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>106169</commentid>
    <comment_count>8</comment_count>
    <who name="Justin Novosad">junov</who>
    <bug_when>2014-05-16 14:25:53 +0000</bug_when>
    <thetext>(In reply to Anne from comment #7)
&gt; Align != redundant ;-)

Yes, I was clarifying not correcting ;-)

&gt; I would expect that the parameter overrides the &lt;img&gt; attribute (acting as
&gt; if the attribute was not specified). If the parameter is not given, the
&gt; &lt;img&gt; attribute would be used.
&gt; 
&gt; That would make specifying the same a no-op and still give full control
&gt; relative to the source image. I don&apos;t see a reason for stacking.

Overriding sounds good to me. Easy to spec in a concise and non-confusing way. Will make sense to devs.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>106179</commentid>
    <comment_count>9</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2014-05-16 16:58:52 +0000</bug_when>
    <thetext>Yeah, I was imagining that this would go back to the original data and override anything specified on &lt;img&gt;.

But we can make this clearer by adding another value:

   use-source-orientation  -  honours &lt;img autorotate&gt;
   raw                     -  takes original raw pixel data
   raw-flipY               -  takes original raw pixel data, flips it vertically
   autorotate              -  honours EXIF
   autorotate-flipY        -  honours EXIF, then flips vertically

The default would be &apos;use-source-orientation&apos;.

(I&apos;m not a fan of these exact names, if anyone has a better suggestion for these names, let me know.)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>125527</commentid>
    <comment_count>10</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2016-03-16 14:15:58 +0000</bug_when>
    <thetext>https://github.com/whatwg/html/pull/741</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>