<?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>278675</bug_id>
          
          <creation_ts>2024-08-26 13:27:20 -0700</creation_ts>
          <short_desc>REGRESSION(275829@main): [GTK][WPE] Images broken in various PDFs</short_desc>
          <delta_ts>2024-09-22 11:01:01 -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>PDF</component>
          <version>Other</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=273435</see_also>
    
    <see_also>https://bugs.webkit.org/show_bug.cgi?id=271726</see_also>
          <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="Michael Catanzaro">mcatanzaro</reporter>
          <assigned_to name="Michael Catanzaro">mcatanzaro</assigned_to>
          <cc>a_protyasha</cc>
    
    <cc>bugs-noreply</cc>
    
    <cc>cgarcia</cc>
    
    <cc>mcatanzaro</cc>
    
    <cc>sabouhallawa</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2055435</commentid>
    <comment_count>0</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2024-08-26 13:27:20 -0700</bug_when>
    <thetext>This is the same as bug #271726, but for GTK/WPE. Unfortunately still we need the JPEG 2000 support for images to work properly in many PDFs. There is a sample PDF attached to bug #271726.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2057640</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2024-09-04 11:01:31 -0700</bug_when>
    <thetext>Plan:

 * Revert 273978@main, bring back OpenJPEG for now
 * Future improvement: ideally try to limit JPEG 2000 to PDF documents only rather than allowing it on the entire web
 * Future improvement: try building OpenJPEG for wasm as part of the PDF.js build process, bug #273435, so we can remove system OpenJPEG dependency again</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2057690</commentid>
    <comment_count>2</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2024-09-04 14:07:44 -0700</bug_when>
    <thetext>(In reply to Michael Catanzaro from comment #1)
&gt;  * Revert 273978@main, bring back OpenJPEG for now

Bad plan. After attempting this, I spent a while trying to figure out why images in PDF documents were still broken. Turns out, this commit actually didn&apos;t break anything.

The only other suspicious commit is 277629@main, but that also didn&apos;t break things.

I will need to bisect this.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2057701</commentid>
    <comment_count>3</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2024-09-04 14:29:02 -0700</bug_when>
    <thetext>Wow, we actually have multiple bugs.

Test document one is https://bug-271726-attachments.webkit.org/attachment.cgi?id=470613

Test document two is https://insurance.mo.gov/earthquake/documents/EarthquakeInsuranceMarketsInMissouriReport20197-8-2019_000.pdf

They did not break at the same time. At the first step of my bisect, I can display test document one, but not test document two. :S

So now I&apos;ll bisect twice.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2057996</commentid>
    <comment_count>4</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2024-09-05 12:23:54 -0700</bug_when>
    <thetext>(In reply to Michael Catanzaro from comment #3)
&gt; Test document two is
&gt; https://insurance.mo.gov/earthquake/documents/
&gt; EarthquakeInsuranceMarketsInMissouriReport20197-8-2019_000.pdf

Unfortunately this broke in 275829@main &quot;[GTK] Make it possible to build with Skia instead of Cairo&quot;.

Let&apos;s focus this bug report on this issue. I will create a separate bug report for the problem with test document one.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2058001</commentid>
    <comment_count>5</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2024-09-05 12:47:57 -0700</bug_when>
    <thetext>(In reply to Michael Catanzaro from comment #4) 
&gt; Unfortunately this broke in 275829@main &quot;[GTK] Make it possible to build
&gt; with Skia instead of Cairo&quot;.

Building with -DUSE_CAIRO=ON does *not* solve the problem, which I suppose is unsurprising, since that commit does not yet actually switch the default from USE_CAIRO to USE_SKIA. I have no guesses as to what aspect of that change breaks PDF images.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2058005</commentid>
    <comment_count>6</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2024-09-05 12:55:05 -0700</bug_when>
    <thetext>(In reply to Michael Catanzaro from comment #4) 
&gt; Let&apos;s focus this bug report on this issue. I will create a separate bug
&gt; report for the problem with test document one.

Test document one displays fine in my development build. It is only broken in Ephy Tech Preview. So I cannot bisect it.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2058984</commentid>
    <comment_count>7</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2024-09-10 08:53:48 -0700</bug_when>
    <thetext>(In reply to Michael Catanzaro from comment #5)
&gt; Building with -DUSE_CAIRO=ON does *not* solve the problem, which I suppose
&gt; is unsurprising, since that commit does not yet actually switch the default
&gt; from USE_CAIRO to USE_SKIA. I have no guesses as to what aspect of that
&gt; change breaks PDF images.

Well today it most certainly does. I made a stupid mistake: the default value of CMake variables doesn&apos;t change unless you delete your build directory, and I didn&apos;t do that when bisecting.

So that&apos;s good news actually. To avoid the regression, we can simply switch back to USE_CAIRO=ON and USE_SKIA=OFF. That would be a quick/easy solution for 2.46.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2059222</commentid>
    <comment_count>8</comment_count>
    <who name="Carlos Garcia Campos">cgarcia</who>
    <bug_when>2024-09-11 00:52:38 -0700</bug_when>
    <thetext>Even better news is that https://github.com/WebKit/WebKit/pull/33122 fixes the issue</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2059315</commentid>
    <comment_count>9</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2024-09-11 09:26:43 -0700</bug_when>
    <thetext>Nice, thanks for investigating!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2062197</commentid>
    <comment_count>10</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2024-09-22 11:01:01 -0700</bug_when>
    <thetext>(In reply to Michael Catanzaro from comment #3)
&gt; Wow, we actually have multiple bugs.
&gt; 
&gt; Test document one is
&gt; https://bug-271726-attachments.webkit.org/attachment.cgi?id=470613
&gt; 
&gt; Test document two is
&gt; https://insurance.mo.gov/earthquake/documents/
&gt; EarthquakeInsuranceMarketsInMissouriReport20197-8-2019_000.pdf

Both are fixed by 283563@main.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>