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

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>148849</bug_id>
          
          <creation_ts>2015-09-04 16:37:20 -0700</creation_ts>
          <short_desc>[iOS] Need a test for bug #145539: Uploading an animated GIF from the photo library uploads a JPEG</short_desc>
          <delta_ts>2015-09-04 17:59:46 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Tools / Tests</component>
          <version>Safari 9</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>iOS 9.0</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Jon Honeycutt">jhoneycutt</reporter>
          <assigned_to name="Jon Honeycutt">jhoneycutt</assigned_to>
          <cc>aestes</cc>
    
    <cc>dbates</cc>
    
    <cc>joepeck</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1123728</commentid>
    <comment_count>0</comment_count>
    <who name="Jon Honeycutt">jhoneycutt</who>
    <bug_when>2015-09-04 16:37:20 -0700</bug_when>
    <thetext>Need a test for bug #145539: Uploading an animated GIF from the photo library uploads a JPEG.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1123740</commentid>
    <comment_count>1</comment_count>
      <attachid>260651</attachid>
    <who name="Jon Honeycutt">jhoneycutt</who>
    <bug_when>2015-09-04 16:52:20 -0700</bug_when>
    <thetext>Created attachment 260651
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1123774</commentid>
    <comment_count>2</comment_count>
      <attachid>260651</attachid>
    <who name="Daniel Bates">dbates</who>
    <bug_when>2015-09-04 17:35:34 -0700</bug_when>
    <thetext>Comment on attachment 260651
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=260651&amp;action=review

&gt; ManualTests/ios/image-file-uploads-as-original-type.html:9
&gt; +                    if (!arrayBuffer || arrayBuffer.byteLength &lt; 6) {

Instead of hardcoding the length of the GIF header (6), I suggest that we use the expression &apos;&quot;GIF89a&quot;.length&apos; so as to make it clear to a reader how we came to require that the file contain at least 6 bytes:

if (!arrayBuffer || arrayBuffer.byteLength &lt; &quot;GIF89a&quot;.length) {

&gt; ManualTests/ios/image-file-uploads-as-original-type.html:15
&gt; +                    var view = new Uint8Array(arrayBuffer, 0, 3);
&gt; +                    var signature = String.fromCharCode(view[0], view[1], view[2]);
&gt; +                    if (signature !== &quot;GIF&quot;) {

This is OK as-is. Since we are requiring that the file contain at least six bytes we may want to consider ensuring that signature is equal to the string &quot;GIF89a&quot;. If you choose to compare to &quot;GIF89a&quot; then I suggest we define a constant say GIFHeader := &quot;GIF89a&quot; and then write line 9, line 13, and line 15 in terms of it.

&gt; ManualTests/ios/image-file-uploads-as-original-type.html:16
&gt; +                        document.getElementById(&quot;console&quot;).innerHTML = &quot;TEST FAILED. File was not of correct type.&quot;;

This is OK as-is. It is sufficient to use either textContent or innerText here since there is no markup in the string.

&gt; ManualTests/ios/image-file-uploads-as-original-type.html:19
&gt; +                    document.getElementById(&quot;console&quot;).innerHTML = &quot;TEST PASSED&quot;;

Ditto.

&gt; ManualTests/ios/image-file-uploads-as-original-type.html:41
&gt; +            &lt;input type=file onchange=&quot;runTest(this)&quot;&gt;

The attribute value quoting style for attribute type (no quotes around &quot;file&quot;) differs from the quoting style used for other HTML attribute values in this file. I suggest that we add quotes around the attribute value for attribute type. Regardless, we should pick an attribute quote style and stick with it throughout this file for consistency.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1123785</commentid>
    <comment_count>3</comment_count>
    <who name="Jon Honeycutt">jhoneycutt</who>
    <bug_when>2015-09-04 17:58:45 -0700</bug_when>
    <thetext>Committed r189410: &lt;http://trac.webkit.org/changeset/189410&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1123786</commentid>
    <comment_count>4</comment_count>
    <who name="Jon Honeycutt">jhoneycutt</who>
    <bug_when>2015-09-04 17:59:46 -0700</bug_when>
    <thetext>(In reply to comment #2)
Thanks for the review! I made your suggested changes before landing.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>260651</attachid>
            <date>2015-09-04 16:52:20 -0700</date>
            <delta_ts>2015-09-04 17:35:34 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>bug-148849-20150904165218.patch</filename>
            <type>text/plain</type>
            <size>3112</size>
            <attacher name="Jon Honeycutt">jhoneycutt</attacher>
            
              <data encoding="base64">U3VidmVyc2lvbiBSZXZpc2lvbjogMTg4MzQ0CmRpZmYgLS1naXQgYS9DaGFuZ2VMb2cgYi9DaGFu
Z2VMb2cKaW5kZXggODI4YjRkNzBmMDMwZWMzM2ExOGU1MTJlYjJiNzJjYWJhZGRkZDc0My4uOTkx
MGE5MmJjZDVkYjRhZmIyMDZkZjIwNmM2MzY2MzZkZTlhOWE0YyAxMDA2NDQKLS0tIGEvQ2hhbmdl
TG9nCisrKyBiL0NoYW5nZUxvZwpAQCAtMSwzICsxLDE2IEBACisyMDE1LTA5LTA0ICBKb24gSG9u
ZXljdXR0ICA8amhvbmV5Y3V0dEBhcHBsZS5jb20+CisKKyAgICAgICAgW2lPU10gTmVlZCBhIHRl
c3QgZm9yIGJ1ZyAjMTQ1NTM5OiBVcGxvYWRpbmcgYW4gYW5pbWF0ZWQgR0lGIGZyb20gdGhlCisg
ICAgICAgIHBob3RvIGxpYnJhcnkgdXBsb2FkcyBhIEpQRUcKKyAgICAgICAg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vYWRzLWFzLW9yaWdpbmFsLXR5cGUu
aHRtbApAQCAtMCwwICsxLDQ0IEBACis8IURPQ1RZUEUgaHRtbD4KKzxodG1sPgorICAgIDxoZWFk
PgorICAgICAgICA8c2NyaXB0PgorICAgICAgICAgICAgZnVuY3Rpb24gcnVuVGVzdChmaWxlQ29u
dHJvbCkgeworICAgICAgICAgICAgICAgIHZhciByZWFkZXIgPSBuZXcgRmlsZVJlYWRlcigpOwor
ICAgICAgICAgICAgICAgIHJlYWRlci5vbmxvYWQgPSBmdW5jdGlvbihlKSB7CisgICAgICAgICAg
ICAgICAgICAgIHZhciBhcnJheUJ1ZmZlciA9IHJlYWRlci5yZXN1bHQ7CisgICAgICAgICAgICAg
ICAgICAgIGlmICghYXJyYXlCdWZmZXIgfHwgYXJyYXlCdWZmZXIuYnl0ZUxlbmd0aCA8IDYpIHsK
KyAgICAgICAgICAgICAgICAgICAgICAgIGRvY3VtZW50LmdldEVsZW1lbnRCeUlkKCJjb25zb2xl
IikuaW5uZXJIVE1MID0gIlRFU1QgRkFJTEVELiBGYWlsZWQgdG8gZ2V0IGFycmF5IGJ1ZmZlciBm
b3IgZmlsZS4iOworICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAg
ICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIHZhciB2aWV3ID0gbmV3IFVpbnQ4QXJyYXko
YXJyYXlCdWZmZXIsIDAsIDMpOworICAgICAgICAgICAgICAgICAgICB2YXIgc2lnbmF0dXJlID0g
U3RyaW5nLmZyb21DaGFyQ29kZSh2aWV3WzBdLCB2aWV3WzFdLCB2aWV3WzJdKTsKKyAgICAgICAg
ICAgICAgICAgICAgaWYgKHNpZ25hdHVyZSAhPT0gIkdJRiIpIHsKKyAgICAgICAgICAgICAgICAg
ICAgICAgIGRvY3VtZW50LmdldEVsZW1lbnRCeUlkKCJjb25zb2xlIikuaW5uZXJIVE1MID0gIlRF
U1QgRkFJTEVELiBGaWxlIHdhcyBub3Qgb2YgY29ycmVjdCB0eXBlLiI7CisgICAgICAgICAgICAg
ICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAg
ICAgICAgZG9jdW1lbnQuZ2V0RWxlbWVudEJ5SWQoImNvbnNvbGUiKS5pbm5lckhUTUwgPSAiVEVT
VCBQQVNTRUQiOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICByZWFkZXIucmVh
ZEFzQXJyYXlCdWZmZXIoZmlsZUNvbnRyb2wuZmlsZXNbMF0pOworICAgICAgICAgICAgfQorICAg
ICAgICA8L3NjcmlwdD4KKyAgICA8L2hlYWQ+CisgICAgPGJvZHk+CisgICAgICAgIDxkaXY+Cisg
ICAgICAgICAgICBUaGlzIGlzIGEgdGVzdCBmb3IgQnVnICM8YSBocmVmPSJodHRwOi8vdHJhYy53
ZWJraXQub3JnL2NoYW5nZXNldC8xODUyNDEiPjE4NTI0MTwvYT46IFtpT1NdIFVwbG9hZGluZyBh
biBhbmltYXRlZCBHSUYgZnJvbSB0aGUgcGhvdG8gbGlicmFyeSB1cGxvYWRzIGEgSlBFRy4KKyAg
ICAgICAgICAgIDxicj48YnI+CisgICAgICAgICAgICBUaGlzIHRlc3Qgc2hvdWxkIGJlIHJ1biBv
biBpT1MuIElmIHRoZSB0ZXN0IHBhc3NlcywgVEVTVCBQQVNTRUQgd2lsbCBhcHBlYXIgYmVsb3cu
CisgICAgICAgICAgICA8YnI+PGJyPgorICAgICAgICAgICAgPGRpdiBpZD0iY29uc29sZSI+V2Fp
dGluZyBvbiB0ZXN0IHRvIGNvbXBsZXRlLi4uPC9kaXY+CisgICAgICAgICAgICA8YnI+PGJyPgor
ICAgICAgICA8L2Rpdj4KKyAgICAgICAgPGRpdj4KKyAgICAgICAgICAgIExvbmctcHJlc3Mgb24g
dGhpcyBpbWFnZSwgYW5kIHNhdmUgaXQgdG8geW91ciBwaG90byBsaWJyYXJ5OgorICAgICAgICAg
ICAgPGltZyBzcmM9Ii4uL3Jlc291cmNlcy9ub24tYW5pbWF0ZWQuZ2lmIj4KKyAgICAgICAgPC9k
aXY+CisgICAgICAgIDxicj4KKyAgICAgICAgPGRpdj4KKyAgICAgICAgICAgIFRhcCAiQ2hvb3Nl
IEZpbGUsIiBhbmQgc2VsZWN0IHRoZSBpbWFnZSBmcm9tIHlvdXIgcGhvdG8gbGlicmFyeToKKyAg
ICAgICAgICAgIDxpbnB1dCB0eXBlPWZpbGUgb25jaGFuZ2U9InJ1blRlc3QodGhpcykiPgorICAg
ICAgICA8L2Rpdj4KKyAgICA8L2JvZHk+Cis8L2h0bWw+Cg==
</data>
<flag name="review"
          id="285858"
          type_id="1"
          status="+"
          setter="dbates"
    />
          </attachment>
      

    </bug>

</bugzilla>