<?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>13060</bug_id>
          
          <creation_ts>2011-06-25 16:38:46 +0000</creation_ts>
          <short_desc>Need to define how JPEG-push images are handled</short_desc>
          <delta_ts>2011-09-30 17:35:32 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>HTML WG</product>
          <component>LC1 HTML5 spec</component>
          <version>unspecified</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P4</priority>
          <bug_severity>enhancement</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="David Humphrey [:humph]">david.humphrey</reporter>
          <assigned_to name="Ian &apos;Hixie&apos; Hickson">ian</assigned_to>
          <cc>ayg</cc>
    
    <cc>bobby</cc>
    
    <cc>bzbarsky</cc>
    
    <cc>ian</cc>
    
    <cc>mike</cc>
    
    <cc>philipj</cc>
    
    <cc>public-html-admin</cc>
    
    <cc>public-html-wg-issue-tracking</cc>
          
          <qa_contact name="HTML WG Bugzilla archive list">public-html-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>50314</commentid>
    <comment_count>0</comment_count>
      <attachid>1005</attachid>
    <who name="David Humphrey [:humph]">david.humphrey</who>
    <bug_when>2011-06-25 16:38:46 +0000</bug_when>
    <thetext>Created attachment 1005
DrawImage test case with MJPG (traffic web cam)

Currently, the canvas2d drawImage() spec says:

&quot;When the drawImage() method is passed an animated image as its image argument, the user agent must use the poster frame of the animation, or, if there is no poster frame, the first frame of the animation.&quot;

It then goes on to discuss the special case of HTMLVideoElements:

&quot;When the image argument is an HTMLVideoElement, then the frame at the current playback position must be used as the source image, and the source image&apos;s dimensions must be the intrinsic width and intrinsic height of the media resource (i.e. after any aspect-ratio correction has been applied).&quot;

I&apos;d like to suggest that MJPG files are often used in place of video, especially with security cameras and other web camera feeds.  Some browser vendors already take the same position, for example Chrome and Safari, which will use the current image (frame) of the MJPG when it is passed to drawImage().  Firefox currently tries to do what the spec says, and load the first frame.  I&apos;ve filed a bug with Mozilla, as well:

https://bugzilla.mozilla.org/show_bug.cgi?id=667206

I believe that WebKit&apos;s behaviour is useful and least surprising here, even though not spec compliant.  I&apos;d like to suggest that this behaviour be considered as the correct one for the spec going forward, and that spec be changed.

I&apos;ve included a simple test case.

Thanks for considering this.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>50321</commentid>
    <comment_count>1</comment_count>
    <who name="Boris Zbarsky">bzbarsky</who>
    <bug_when>2011-06-26 15:04:17 +0000</bug_when>
    <thetext>&gt; Firefox currently tries to do what the spec says, and load the first frame.

Actually, it doesn&apos;t.  The problem there is that in Gecko an MJPEG image is never actually done loading for purposes of our internal test.  I&apos;ll follow up in the Gecko bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>52806</commentid>
    <comment_count>2</comment_count>
    <who name="Michael[tm] Smith">mike</who>
    <bug_when>2011-08-04 05:04:20 +0000</bug_when>
    <thetext>mass-move component to LC1</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>54673</commentid>
    <comment_count>3</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2011-08-11 06:14:33 +0000</bug_when>
    <thetext>A resource delivered as a mutipart/replace package containing a series of JPEG payloads is no a single image; it&apos;s a whole series of images.

As currently specced, a &lt;canvas&gt; element&apos;s drawImage() method would do nothing if invoked with an &lt;img&gt; using an infinite multipart/replace resource, because such an image is never fully decodable. In fact, how to handle multipart/replace isn&apos;t really defined by the spec at all even for regular &lt;img&gt; purposes.

I guess what I should do is update the tasks queued by the &quot;update the image data&quot; algorithm so that if the resource is actually a multipart/replace resource, each subresource updates the image data and the image is marked as fully decodable as soon as the first one is found. Then it should all just work.

Does that seem ok?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>57488</commentid>
    <comment_count>4</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2011-09-28 23:18:51 +0000</bug_when>
    <thetext>EDITOR&apos;S RESPONSE: This is an Editor&apos;s Response to your comment. If you are satisfied with this response, please change the state of this bug to CLOSED. If you have additional information and would like the editor to reconsider, please reopen this bug. If you would like to escalate the issue to the full HTML Working Group, please add the TrackerRequest keyword to this bug, and suggest title and text for the tracker issue; or you may create a tracker issue yourself, if you are able to do so. For more details, see this document:
   http://dev.w3.org/html5/decision-policy/decision-policy.html

Status: Accepted
Change Description: see diff given below
Rationale: Concurred with reporter&apos;s comments.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>57494</commentid>
    <comment_count>5</comment_count>
    <who name="">contributor</who>
    <bug_when>2011-09-29 00:24:17 +0000</bug_when>
    <thetext>Checked in as WHATWG revision r6596.
Check-in comment: Specify multipart/x-mixed-replace
http://html5.org/tools/web-apps-tracker?from=6595&amp;to=6596</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>1005</attachid>
            <date>2011-06-25 16:38:46 +0000</date>
            <delta_ts>2011-06-25 16:38:46 +0000</delta_ts>
            <desc>DrawImage test case with MJPG (traffic web cam)</desc>
            <filename>index.html</filename>
            <type>text/html</type>
            <size>607</size>
            <attacher name="David Humphrey [:humph]">david.humphrey</attacher>
            
              <data encoding="base64">PGh0bWw+CjxoZWFkPgogIDx0aXRsZT5NSlBHIERyYXdJbWFnZSBUZXN0IENhc2U8L3RpdGxlPgo8
L2hlYWQ+Cjxib2R5Pgo8ZGl2PgogIDxoMj5NSlBHIE9yaWdpbmFsPC9oMj4KICA8aW1nIGlkPSJt
anBnIiBzcmM9Imh0dHA6Ly9jYW0udGhlc3lsdmFoZXJhbGQuY29tL21qcGcvdmlkZW8ubWpwZyIg
Lz4KPC9kaXY+CjxkaXY+CiAgPGgyPkNhbnZhcyBDb3B5PC9oMj4KICA8Y2FudmFzIGlkPSJjYW52
YXMiIHdpZHRoPSI2NDAiIGhlaWdodD0iNDgwIiBzdHlsZT0iYm9yZGVyOjFweCBzb2xpZCBibGFj
ayI+PC9jYW52YXM+CjwvZGl2Pgo8c2NyaXB0PgpmdW5jdGlvbiBsb2FkZWQoKSB7CiAgdmFyIGN0
eCA9IGRvY3VtZW50LmdldEVsZW1lbnRCeUlkKCdjYW52YXMnKS5nZXRDb250ZXh0KCcyZCcpLAog
ICAgICBtanBnID0gZG9jdW1lbnQuZ2V0RWxlbWVudEJ5SWQoJ21qcGcnKTsKCiAgc2V0SW50ZXJ2
YWwoZnVuY3Rpb24oKSB7CiAgICBjdHguZHJhd0ltYWdlKG1qcGcsIDAsIDApOwogIH0sIDMwMDAp
Owp9CgphZGRFdmVudExpc3RlbmVyKCdET01Db250ZW50TG9hZGVkJywgbG9hZGVkLCBmYWxzZSk7
Cjwvc2NyaXB0Pgo8L3NjcmlwdD4KPC9ib2R5Pgo8L2h0bWw+Cg==
</data>

          </attachment>
      

    </bug>

</bugzilla>