Bug 273591 - Copy Image contextual menu item copies png images as tiff
Summary: Copy Image contextual menu item copies png images as tiff
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: HTML Editing (show other bugs)
Version: Safari 17
Hardware: Unspecified macOS 13
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2024-05-01 16:55 PDT by Jeff Johnson
Modified: 2024-05-08 01:30 PDT (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jeff Johnson 2024-05-01 16:55:11 PDT
Example: https://upload.wikimedia.org/wikipedia/commons/thumb/4/47/PNG_transparency_demonstration_1.png/560px-PNG_transparency_demonstration_1.png

When copying a png image, the pasteboard types include public.tiff first and do not include public.png. This is in contrast to Chrome and Firefox, whose pasteboard types have public.png first.
Comment 1 Jeff Johnson 2024-05-01 16:55:56 PDT
This is problem when the paste targe is expecting a png.
Comment 2 Said Abou-Hallawa 2024-05-01 17:23:35 PDT
When copying the above PNG image, these are the formats which get published to the pasteboard by different browsers:

WebKit/Safari:

    public.tiff
    WebURLsWithTitlesP-boardType
    Apple URL pasteboard type
    public.url
    public.url-name
    public.utf8-plain-text
    com.apple.flat.rtfd
    com.apple.webarchive

Chrome:

    public.png
    public.html
    org.chromium.source-url


FireFox:

    public.png
    public.tiff
    public.html
Comment 3 Said Abou-Hallawa 2024-05-01 17:25:34 PDT
I think these formats get published by WebKit in this function:

void Pasteboard::write(const PasteboardImage& pasteboardImage)
Comment 4 Radar WebKit Bug Importer 2024-05-01 17:31:38 PDT
<rdar://problem/127396235>
Comment 5 Alexey Proskuryakov 2024-05-06 13:06:56 PDT
rdar://108612545