| Summary: | Camera RAW files picked via file input are returned as PNG on change | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | sblochwehbas |
| Component: | Forms | Assignee: | Aditya Keerthi <akeerthi> |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | CC: | akeerthi, cdumez, heycam, webkit-bug-importer, wenson_hsieh |
| Priority: | P2 | Keywords: | InRadar |
| Version: | Safari Technology Preview | ||
| Hardware: | Mac (Apple Silicon) | ||
| OS: | macOS 13 | ||
| See Also: | https://bugs.webkit.org/show_bug.cgi?id=260098 | ||
| Attachments: | |||
|
Description
sblochwehbas
2023-06-23 10:16:40 PDT
Created attachment 466816 [details]
Open html file, click file input, select raf or cr3 file. Notice that png file name is printed to screen.
WebKit has logic to automatically transcode images of an unaccepted format, if an accepted format is specified. In the case of RAW images (.raf), `NSURLFileTypeMappings` does not return a MIME type for the extension, and WebKit incorrect excludes the format from the accepted list. However, the file is recognized by ImageIO as an image type, so WebKit converts it to a PNG. I also tried using the UniformTypeIdentifiers framework instead of `NSURLFileTypeMappings`, however the extension is still not associated with a valid MIME type. This is definitely a bug that should be fixed. I think our options are: 1. Reach out to the other frameworks to understand why the type is not recognized. However, even if they add support it wouldn't fix the issue on older OSes. 2. Maintain an additional list of types in WebKit. We sort of already do this for some other formats. 3. Add an exception for transcoding if there is an extension match (don't just rely on MIME types). (2) is probably the safest approach. (3) might also be nice/correct, but could have some compat fallout. For (1), we should at least learn why the types are missing. If we go for (2), we should also confirm that ImageIO recognizes these RAW files on older OS versions. Pull request: https://github.com/WebKit/WebKit/pull/15801 Committed 266049@main (00c3f53f2de4): <https://commits.webkit.org/266049@main> Reviewed commits have been landed. Closing PR #15801 and removing active labels. |