<?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>255425</bug_id>
          
          <creation_ts>2023-04-13 16:54:13 -0700</creation_ts>
          <short_desc>Remove &apos;image.isPDFDocumentImage&apos; from ImageQualityController.cpp</short_desc>
          <delta_ts>2023-04-26 10:21:15 -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>Images</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>INVALID</resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=121207</see_also>
          <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="Ahmad Saleem">ahmad.saleem792</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <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>1948641</commentid>
    <comment_count>0</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2023-04-13 16:54:13 -0700</bug_when>
    <thetext>Hi Team,

While trying to do bug 115158, in the PR 5111, Said mentioned following:

_______________________

I think the image interpolation quality has nothing to do with the PDFDocumentImage. So I think we either need to remove the condition image.isPDFDocumentImage() or we fix the comment.

and

Yes. Please remove image.isPDFDocumentImage() from this if-statement since PDFDocumentImage::draw() does not call the ImagePaintingOptions::interpolationQuality().

________________________

I didn&apos;t get rid of it that time but I think I can do this in this separate bug.

Still present - https://github.com/Ahmad-S792/WebKit/blob/main/Source/WebCore/rendering/ImageQualityController.cpp#L119

Just wanted to raise and also get input again whether it is still good to go.

Happy to do PR.

Thanks!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1950188</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2023-04-20 16:55:21 -0700</bug_when>
    <thetext>&lt;rdar://problem/108345917&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1951358</commentid>
    <comment_count>2</comment_count>
    <who name="Said Abou-Hallawa">sabouhallawa</who>
    <bug_when>2023-04-26 10:11:38 -0700</bug_when>
    <thetext>I think I was wrong.

Looking at the history of ImageQualityController.cpp, I found the bug 121207 added the condition image.isPDFDocumentImage() in ImageQualityController::chooseInterpolationQuality(). I found this statement in the ChangeLog regarding this change:

    * rendering/ImageQualityController.cpp:
    (WebCore::ImageQualityController::shouldPaintAtLowQuality):
    PDFDocumentImage is also interested in/capable of low-quality painting now.

I think this is correct since we usually cache the PDFDocumentImage in a CachedSubImage. And later we draw the ImageBuffer of the CachedSubImage to the GraphicsContext. To draw the ImageBuffer, we have to get a NativeImage from it and then call GraphicsContext::drawNativeImageInternal() which uses ImagePaintingOptions::interpolationQuality() to draw the image and decide whether to use the subImageCache or not.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1951359</commentid>
    <comment_count>3</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2023-04-26 10:21:15 -0700</bug_when>
    <thetext>(In reply to Said Abou-Hallawa from comment #2)
&gt; I think I was wrong.
&gt; 
&gt; Looking at the history of ImageQualityController.cpp, I found the bug 121207
&gt; added the condition image.isPDFDocumentImage() in
&gt; ImageQualityController::chooseInterpolationQuality(). I found this statement
&gt; in the ChangeLog regarding this change:
&gt; 
&gt;     * rendering/ImageQualityController.cpp:
&gt;     (WebCore::ImageQualityController::shouldPaintAtLowQuality):
&gt;     PDFDocumentImage is also interested in/capable of low-quality painting
&gt; now.
&gt; 
&gt; I think this is correct since we usually cache the PDFDocumentImage in a
&gt; CachedSubImage. And later we draw the ImageBuffer of the CachedSubImage to
&gt; the GraphicsContext. To draw the ImageBuffer, we have to get a NativeImage
&gt; from it and then call GraphicsContext::drawNativeImageInternal() which uses
&gt; ImagePaintingOptions::interpolationQuality() to draw the image and decide
&gt; whether to use the subImageCache or not.

Closing my PR and this bug as well as RESOLVED INVALID.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>