<?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>24175</bug_id>
          
          <creation_ts>2013-12-29 22:03:31 +0000</creation_ts>
          <short_desc>Canvas Pixel ArrayBuffer should return RGBA for big-endian and ABGR for little-endian  machines</short_desc>
          <delta_ts>2013-12-31 06:00:47 +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>INVALID</resolution>
          
          
          <bug_file_loc>http://www.whatwg.org/specs/web-apps/current-work/#pixel-manipulation</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P3</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>Unsorted</target_milestone>
          
          <blocked>24177</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter>contributor</reporter>
          <assigned_to name="Ian &apos;Hixie&apos; Hickson">ian</assigned_to>
          <cc>arthuryidi</cc>
    
    <cc>mike</cc>
    
    <cc>vladimir</cc>
          
          <qa_contact>contributor</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>97881</commentid>
    <comment_count>0</comment_count>
    <who name="">contributor</who>
    <bug_when>2013-12-29 22:03:31 +0000</bug_when>
    <thetext>Specification: http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html
Multipage: http://www.whatwg.org/C#pixel-manipulation
Complete: http://www.whatwg.org/c#pixel-manipulation
Referrer: http://www.whatwg.org/specs/web-apps/current-work/multipage/

Comment:
Canvas Pixel ArrayBuffer should return RGBA for big-endian and ABGR for
little-endian  machines

Posted from: 66.229.94.210
User agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>97883</commentid>
    <comment_count>1</comment_count>
    <who name="Arthur Y">arthuryidi</who>
    <bug_when>2013-12-29 23:34:40 +0000</bug_when>
    <thetext>Providing the same order for both platforms is a behavior not consistent with Typed Arrays, which use the client&apos;s platform byte order. This inconsistency gives rise to bloated code and having to test for the platform order.

&quot;A Canvas Pixel ArrayBuffer is an ArrayBuffer that whose data is represented in left-to-right order, row by row top to bottom, starting with the top left, with each pixel&apos;s red, green, blue, and alpha components being given in that order for each pixel.&quot; [1]

[1] http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-imagedata-data</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>97887</commentid>
    <comment_count>2</comment_count>
    <who name="Vladimir Vukicevic (Mozilla)">vladimir</who>
    <bug_when>2013-12-30 03:18:11 +0000</bug_when>
    <thetext>(In reply to Arthur Y from comment #1)
&gt; Providing the same order for both platforms is a behavior not consistent
&gt; with Typed Arrays, which use the client&apos;s platform byte order. This
&gt; inconsistency gives rise to bloated code and having to test for the platform
&gt; order.

I don&apos;t see an inconsistency -- the ImageData&apos;s data element is a Uint8ClampedArray, with the pixels&apos; values coming explicitly in the order of R G B A, as individual bytes.  Endianness issues do not apply.  If you reach under and access the ArrayBuffer directly and create a new 32-bit view of the data, then yes, you are exposed to endianness issues; at that point that&apos;s just a general typed array situation, and is consistent with other typed array behaviour.  That&apos;s no different than mapping any arbitrary 8-bit data to 32-bit values.

This seems like it&apos;s INVALID to me, but maybe I&apos;m misunderstanding the request?</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>