<?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>300903</bug_id>
          
          <creation_ts>2025-10-16 10:17:21 -0700</creation_ts>
          <short_desc>REGRESSION(293871@main): WeChat app allocates large sizes of memory for high resolution images on iOS 26</short_desc>
          <delta_ts>2025-10-17 10:51:59 -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>FIXED</resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=291765</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="Said Abou-Hallawa">sabouhallawa</reporter>
          <assigned_to name="Said Abou-Hallawa">sabouhallawa</assigned_to>
          <cc>sabouhallawa</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2151704</commentid>
    <comment_count>0</comment_count>
    <who name="Said Abou-Hallawa">sabouhallawa</who>
    <bug_when>2025-10-16 10:17:21 -0700</bug_when>
    <thetext>The change 293871@main removes setting the value for the key kCGImageSourceSubsampleFactor in the decoding options. This option is very useful when decoding a high resolution image which will be displayed on a much smaller rectangle. ImageIO decodes the image with a smaller rectangle in this case. This saves memory and CPU time.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2151705</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2025-10-16 10:17:27 -0700</bug_when>
    <thetext>&lt;rdar://problem/162787553&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2151716</commentid>
    <comment_count>2</comment_count>
    <who name="Said Abou-Hallawa">sabouhallawa</who>
    <bug_when>2025-10-16 10:48:12 -0700</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/52489</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2152042</commentid>
    <comment_count>3</comment_count>
    <who name="Said Abou-Hallawa">sabouhallawa</who>
    <bug_when>2025-10-17 07:12:53 -0700</bug_when>
    <thetext>Here are other repro steps:

1. On macOS lunch mini-browser or Safari
2. Lunch Activity Monitor to monitor the WebKit allocated memory
3. Open https://upload.wikimedia.org/wikipedia/commons/e/ea/Van_Gogh_-_Starry_Night_-_Google_Art_Project.jpg

Result: WebKit allocates about 3GB and it may eventually jetsam and crash
Expected: WebKit allocates about 200-400 MB and it does not jetsam or crash
Note: The size of this image = { 30000 x 23756 }. The memory for decoding this image for its natural size = 30000 x 23756 x 4 = 2.7 GB. But since the window size is much smaller than the natural size of the image, the image should not be decoded for its natural size. This is called image sub-sampling which was dropped by 293871@main.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2152129</commentid>
    <comment_count>4</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2025-10-17 10:51:57 -0700</bug_when>
    <thetext>Committed 301729@main (c4dc35645e7b): &lt;https://commits.webkit.org/301729@main&gt;

Reviewed commits have been landed. Closing PR #52489 and removing active labels.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>