Bug 230855
| Summary: | Canvas memory limit of 4096 × 4096 pixels when calling ctx.getImageData | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Bramus <bramus> |
| Component: | Canvas | Assignee: | Nobody <webkit-unassigned> |
| Status: | NEW | ||
| Severity: | Normal | CC: | daniel, dino, ik, jarek, kevin_neal, lwarlow, mmaxfield, sabouhallawa, simon.fraser, thorton, vepomoc, webkit-bug-importer |
| Priority: | P2 | Keywords: | InRadar |
| Version: | Safari Technology Preview | ||
| Hardware: | Unspecified | ||
| OS: | macOS 11 | ||
| See Also: |
https://bugs.webkit.org/show_bug.cgi?id=230887 https://bugs.webkit.org/show_bug.cgi?id=144335 |
||
Bramus
Spotted on Twitter [1], by Rik Schennink
“Safari 15 has a canvas memory limit of 4096 × 4096 pixels where Safari 14 could deal with resolutions up to 16384 x 16384”
Can verify via the CodePen Demo [2] Rik also shared, in which he creates a 4097x4097 canvas. Upon calling `ctx.getImageData(0, 0, size, size)` the code fails.
“Unable to get image data from canvas. Requested size was 4097 x 4097”
While searching for bugs I did find [3] where the limit was added for iOS, but this is now applied on macOS too apparently. Is this a regression?
[1] https://twitter.com/rikschennink/status/1442443774748082185
[2] https://codepen.io/rikschennink/pen/YzQRdwZ
[3] https://bugs.webkit.org/show_bug.cgi?id=145998
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Bramus
I read in https://bugs.webkit.org/show_bug.cgi?id=229237 that the “2D memory limit” test got marked as expected to Crash, so I guess that that explains why this went undetected?
Bramus
Update: Creating a canvas of 16384 x 16384 on macOS and drawing on it still works. It's only when calling `ctx.getImageData` that Safari fails to cooperate.
Kevin Neal
Thank you for filing. The appropriate engineers have been notified.
Radar WebKit Bug Importer
<rdar://problem/83671710>
Myles C. Maxfield
<rdar://problem/83575501>
Myles C. Maxfield
static const float MaxClampedLength = 4096;
static const float MaxClampedArea = MaxClampedLength * MaxClampedLength;
Myles C. Maxfield
Might have been caused by https://bugs.webkit.org/show_bug.cgi?id=144335?
Simon Fraser (smfr)
Or by the GPU Process?