RESOLVED FIXED296208
Problems with copyExternalImageToTexture
https://bugs.webkit.org/show_bug.cgi?id=296208
Summary Problems with copyExternalImageToTexture
castano
Reported 2025-07-18 15:01:14 PDT
I've encountered two new problems in `copyExternalImageToTexture`: 1.- Is loading grayscale images such as: https://ludicon.com/sparkjs/assets/rocky_trail_rough_1k-DzyprOPd.png It appears as if the grayscale image as interpreted as an alpha image blended against a pink background. 2.- Is loading svg files such as: https://ludicon.com/sparkjs/assets/Tiger-vZ19_T4F.svg The svg image is not rendered. You can easily reproduce these two issues in this website: https://ludicon.com/sparkjs/ I've confirmed the two issues occur in the latest Safari Technology Preview in macOS. Chrome and Firefox handle these files correctly. I hope these problems can be addressed before the OS 26 release!
Attachments
WebKit main 1st issue (4.81 MB, image/png)
2025-07-19 09:26 PDT, Mike Wyrzykowski
no flags
WebKit main 2nd issue (385.73 KB, image/png)
2025-07-19 09:27 PDT, Mike Wyrzykowski
no flags
SVG (1.40 MB, image/png)
2025-08-14 20:14 PDT, Mike Wyrzykowski
no flags
Mike Wyrzykowski
Comment 1 2025-07-19 09:26:57 PDT
Created attachment 476112 [details] WebKit main 1st issue
Mike Wyrzykowski
Comment 2 2025-07-19 09:27:22 PDT
Created attachment 476113 [details] WebKit main 2nd issue
Mike Wyrzykowski
Comment 3 2025-07-19 09:29:04 PDT
Attaching current behavior on WebKit main branch from iOS Possibly related to https://bugs.webkit.org/show_bug.cgi?id=295357 Will try on macOS next week
Radar WebKit Bug Importer
Comment 4 2025-07-19 09:29:58 PDT
Mike Wyrzykowski
Comment 5 2025-07-25 13:39:09 PDT
I am unable to reproduce this locally on macOS, can you please verify if you reproduce on macOS Tahoe Beta 4?
Mike Wyrzykowski
Comment 6 2025-07-25 13:39:56 PDT
or alternatively Safari Technology Preview 224 which should be a similar version of WebKit
castano
Comment 7 2025-07-26 20:18:24 PDT
I'm currently testing Safari Technology Preview 223. Let me try to upgrade.
castano
Comment 8 2025-07-26 20:37:56 PDT
Upgraded to 224 and the problem still persists. Note, the problem does not occur when loading the images normally, but when loading the referenced images as WebGPU textures through `copyExternalImageToTexture`. The problem can be reproduced easily through: https://ludicon.com/sparkjs/ The problematic images should appear in the gallery section and selecting them will display them in the WebGPU canvas. It should be possible to reproduce this issue with any other WebGPU example that uses the `copyExternalImageToTexture` API to load images.
Mike Wyrzykowski
Comment 9 2025-07-27 11:12:58 PDT
Re-opening due to the above comment
Mike Wyrzykowski
Comment 10 2025-07-27 11:16:01 PDT
Loading images via the gallery indeed exhibits some issues as opposed to directly opening the links
Mike Wyrzykowski
Comment 11 2025-08-14 19:41:54 PDT
I no longer reproduce the rocky_trail_rough_1k-DzyprOPd.png issue on Safari Technology Preview 225 (WebKit 21623.1.1.1) The SVG issue is still reproducible
Mike Wyrzykowski
Comment 12 2025-08-14 19:46:15 PDT
The SVG doesn't load because we only support bitmaps currently: ``` RefPtr image = dynamicDowncast<BitmapImage>(cachedImage->image()); if (!image) return callback({ }, 0, 0); ``` cachedImage->image() is a WebCore::SVGImage
Mike Wyrzykowski
Comment 13 2025-08-14 20:14:16 PDT
Created attachment 476416 [details] SVG Seems to fix it
Mike Wyrzykowski
Comment 14 2025-08-14 20:20:18 PDT
EWS
Comment 15 2025-08-15 10:14:14 PDT
Committed 298758@main (e12b378f7885): <https://commits.webkit.org/298758@main> Reviewed commits have been landed. Closing PR #49438 and removing active labels.
Mike Wyrzykowski
Comment 16 2025-08-15 10:15:38 PDT
This should be fixed on webkit main now, I will followup once it lands in STP
castano
Comment 17 2025-08-15 12:17:50 PDT
Thanks for the quick turnaround!
Mike Wyrzykowski
Comment 18 2025-08-15 13:33:01 PDT
Of course :) please let me know if you encounter any other incompatibilities!
Note You need to log in before you can comment on or make changes to this bug.