Bug 273591

Summary: Copy Image contextual menu item copies png images as tiff
Product: WebKit Reporter: Jeff Johnson <opendarwin>
Component: HTML EditingAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: ap, karlcow, sabouhallawa, webkit-bug-importer, wenson_hsieh
Priority: P2 Keywords: InRadar
Version: Safari 17   
Hardware: Unspecified   
OS: macOS 13   

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