Bug 263756
| Summary: | [ macOS ] Enable image sub sampling for macOS | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Said Abou-Hallawa <sabouhallawa> |
| Component: | Images | Assignee: | Said Abou-Hallawa <sabouhallawa> |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | CC: | sabouhallawa, webkit-bug-importer |
| Priority: | P2 | Keywords: | InRadar |
| Version: | WebKit Nightly Build | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
Said Abou-Hallawa
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.
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/117561288>
Said Abou-Hallawa
Pull request: https://github.com/WebKit/WebKit/pull/19618
EWS
Committed 269875@main (a638930cea32): <https://commits.webkit.org/269875@main>
Reviewed commits have been landed. Closing PR #19618 and removing active labels.