Open these links in WebKit on macOS: 1. https://upload.wikimedia.org/wikipedia/commons/e/ea/Van_Gogh_-_Starry_Night_-_Google_Art_Project.jpg 2. https://cdn.esawebb.org/archives/images/large/weic2205a.jpg Result: Display is very slow and part of the image is not shown or shown black. This happens because these images have super gigantic sizes. The first image has size = { 30,000 x 23,756 }. Because on macOS, we do not allow image sub-sampling, the whole image has to be decoded. This will require memory with size = 30,000 x 23,756 x 4 ~= 2.85 GB. But usually we need to scale it down to the screen size which can be something like { 3,000 x 2,400 }. This means in this sase the image will be scaled down to 1/100 of its natural size. This means every 100 pixels are mapped to 1 single pixel. So we do not need to decode the image with the natural size and the natural quality in this case. This can be fixed by using image sub sampling which will reduce the memory allocation and the decoding time. Image sub sampling is already enabled on iOS.
<rdar://problem/117561288>
Pull request: https://github.com/WebKit/WebKit/pull/19618
Committed 269875@main (a638930cea32): <https://commits.webkit.org/269875@main> Reviewed commits have been landed. Closing PR #19618 and removing active labels.