<?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>248249</bug_id>
          
          <creation_ts>2022-11-22 16:13:12 -0800</creation_ts>
          <short_desc>Some valid JP2s are failing to decode</short_desc>
          <delta_ts>2022-11-24 15:37:25 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Images</component>
          <version>Safari 16</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Eric Portis">e</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>karlcow</cc>
    
    <cc>sabouhallawa</cc>
    
    <cc>simon.fraser</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1914197</commentid>
    <comment_count>0</comment_count>
    <who name="Eric Portis">e</who>
    <bug_when>2022-11-22 16:13:12 -0800</bug_when>
    <thetext>This valid JPEG2000 file does not decode in Safari 16 running on macOS Ventura 13.0.1, MacOS Monterey 12.6, or iOS 16.1.1.

https://assets.meinauto.de/image/upload/f_jp2,w_3249/v1668594966/website/pics/landingpages/black-deals/red

Note:
- Changing the image slightly (resizing by one pixel) causes it to work: https://assets.meinauto.de/image/upload/f_jp2,w_3248/v1668594966/website/pics/landingpages/black-deals/red
- This bug seems *very* related to FB9671920 / https://bugs.webkit.org/show_bug.cgi?id=219977

I have cross-filed this as FB11815925, and fully expect this WebKit bug to be closed as RESOLVED INVALID, because the bug is in the media handling layers in the OS. However previous experience has shown it is valuable to have a public URL to reference and share resources/workarounds when others run into this bug in Safari.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1914198</commentid>
    <comment_count>1</comment_count>
    <who name="Eric Portis">e</who>
    <bug_when>2022-11-22 16:15:01 -0800</bug_when>
    <thetext>I should also note it seems extremely related to https://bugs.webkit.org/show_bug.cgi?id=219977 &amp; FB9671920, which seems to have been recently fully fixed?

Just as with that bug, the issue only seems to affect very &quot;simple&quot; images (for example, but not limited to: single-color images).

I will update both this and the feedback as I find more examples of failing JP2s.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1914201</commentid>
    <comment_count>2</comment_count>
    <who name="Eric Portis">e</who>
    <bug_when>2022-11-22 16:37:37 -0800</bug_when>
    <thetext>The JP2s seem to fail consistently when they are over a certain size.

Setting the &quot;width&quot; parameter in this URL to anything over 3248 generates a failing image:

https://assets.meinauto.de/image/upload/f_jp2,w_3250/v1668594966/website/pics/landingpages/black-deals/red

Anything under 3248 succeeds:

https://assets.meinauto.de/image/upload/f_jp2,w_325/v1668594966/website/pics/landingpages/black-deals/red

Changing the color space to CMYK seems to change this boundary to 3260

https://assets.meinauto.de/image/upload/f_jp2,w_3260,cs_cmyk/website/pics/landingpages/black-deals/red (WORKS)

https://assets.meinauto.de/image/upload/f_jp2,w_3261,cs_cmyk/website/pics/landingpages/black-deals/red (FAILS)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1914229</commentid>
    <comment_count>3</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2022-11-22 20:24:16 -0800</bug_when>
    <thetext>&lt;rdar://problem/102617161&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1914300</commentid>
    <comment_count>4</comment_count>
    <who name="Sam Sneddon [:gsnedders]">gsnedders</who>
    <bug_when>2022-11-23 04:11:13 -0800</bug_when>
    <thetext>&gt; I have cross-filed this as FB11815925

rdar://102613994</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1914473</commentid>
    <comment_count>5</comment_count>
    <who name="Sam Sneddon [:gsnedders]">gsnedders</who>
    <bug_when>2022-11-24 06:09:06 -0800</bug_when>
    <thetext>Karl: not sure how this is BrowserCompat? failing to decode JPEG2000 arguably just makes us behave the same as everyone else (who don&apos;t support JPEG2000); I guess it could lead to site compat problems with usage of content negotiation or similar, as we&apos;ll get served a JPEG2000 image and then fail to render it.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1914562</commentid>
    <comment_count>6</comment_count>
    <who name="Karl Dubost">karlcow</who>
    <bug_when>2022-11-24 15:37:25 -0800</bug_when>
    <thetext>Hmm Indeed. Sorry about that.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>