Skip to content

Conversation

@shallawa
Copy link
Contributor

@shallawa shallawa commented Oct 16, 2025

c4dc356

REGRESSION(293871@main): WeChat app allocates large sizes of memory for high resolution images on iOS 26
https://bugs.webkit.org/show_bug.cgi?id=300903
rdar://162787553

Reviewed by Simon Fraser.

293871@main removes setting the value for the key kCGImageSourceSubsampleFactor
in the decoding options. This option is 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.

* Source/WebCore/platform/graphics/cg/ImageDecoderCG.cpp:
(WebCore::appendImageSourceOption):
(WebCore::imageSourceMetadataOptions):
(WebCore::imageSourceOptions):
(WebCore::imageSourceThumbnailOptions):
(WebCore::ImageDecoderCG::hasHDRGainMap const):
(WebCore::ImageDecoderCG::frameDensityCorrectedSizeAtIndex const):
(WebCore::ImageDecoderCG::fetchFrameMetaDataAtIndex const):
(WebCore::createImageSourceMetadataOptions): Deleted.
(WebCore::appendImageSourceOptions): Deleted.

Canonical link: https://commits.webkit.org/301729@main

d8a7182

Misc iOS, visionOS, tvOS & watchOS macOS Linux Windows Apple Internal
✅ 🧪 style ✅ 🛠 ios ✅ 🛠 mac ✅ 🛠 wpe ✅ 🛠 win ✅ 🛠 ios-apple
✅ 🧪 bindings ✅ 🛠 ios-sim ✅ 🛠 mac-AS-debug ✅ 🧪 wpe-wk2 ✅ 🧪 win-tests ✅ 🛠 mac-apple
✅ 🧪 webkitperl ✅ 🧪 ios-wk2 ✅ 🧪 api-mac ❌ 🧪 api-wpe ✅ 🛠 vision-apple
✅ 🧪 ios-wk2-wpt ✅ 🧪 mac-wk1 ✅ 🛠 wpe-cairo
✅ 🧪 api-ios ✅ 🧪 mac-wk2 ✅ 🛠 gtk
✅ 🛠 vision ✅ 🧪 mac-AS-debug-wk2 ✅ 🧪 gtk-wk2
✅ 🛠 vision-sim ✅ 🧪 mac-wk2-stress ✅ 🧪 api-gtk
✅ 🛠 🧪 merge ✅ 🧪 vision-wk2 ✅ 🧪 mac-intel-wk2 ✅ 🛠 playstation
✅ 🛠 tv ✅ 🛠 mac-safer-cpp
✅ 🛠 tv-sim
✅ 🛠 watch
✅ 🛠 watch-sim

@shallawa shallawa self-assigned this Oct 16, 2025
@shallawa shallawa added the Images For bugs in image handling. label Oct 16, 2025
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Oct 16, 2025
@shallawa shallawa removed the merging-blocked Applied to prevent a change from being merged label Oct 16, 2025
@shallawa shallawa force-pushed the eng/REGRESSION-293871-main-WeChat-app-allocates-large-sizes-of-memory-for-high-resolution-images-on-iOS-26 branch from 47439dd to d8a7182 Compare October 16, 2025 19:19
@shallawa shallawa requested a review from smfr October 16, 2025 21:43
@shallawa
Copy link
Contributor Author

I wrote a test case for this PR but it requires adding a gigantic image. The size of this image is 11 MB. I am not sure whether it is okay to submit such a big file or not. I will address adding a layout test in a separate patch.

@shallawa shallawa added the merge-queue Applied to send a pull request to merge-queue label Oct 17, 2025
…or high resolution images on iOS 26

https://bugs.webkit.org/show_bug.cgi?id=300903
rdar://162787553

Reviewed by Simon Fraser.

293871@main removes setting the value for the key kCGImageSourceSubsampleFactor
in the decoding options. This option is 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.

* Source/WebCore/platform/graphics/cg/ImageDecoderCG.cpp:
(WebCore::appendImageSourceOption):
(WebCore::imageSourceMetadataOptions):
(WebCore::imageSourceOptions):
(WebCore::imageSourceThumbnailOptions):
(WebCore::ImageDecoderCG::hasHDRGainMap const):
(WebCore::ImageDecoderCG::frameDensityCorrectedSizeAtIndex const):
(WebCore::ImageDecoderCG::fetchFrameMetaDataAtIndex const):
(WebCore::createImageSourceMetadataOptions): Deleted.
(WebCore::appendImageSourceOptions): Deleted.

Canonical link: https://commits.webkit.org/301729@main
@webkit-commit-queue webkit-commit-queue force-pushed the eng/REGRESSION-293871-main-WeChat-app-allocates-large-sizes-of-memory-for-high-resolution-images-on-iOS-26 branch from d8a7182 to c4dc356 Compare October 17, 2025 17:51
@webkit-commit-queue
Copy link
Collaborator

Committed 301729@main (c4dc356): https://commits.webkit.org/301729@main

Reviewed commits have been landed. Closing PR #52489 and removing active labels.

@webkit-commit-queue webkit-commit-queue merged commit c4dc356 into WebKit:main Oct 17, 2025
@webkit-commit-queue webkit-commit-queue removed the merge-queue Applied to send a pull request to merge-queue label Oct 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Images For bugs in image handling.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants