Bug 212339 - [Clipboard API] Support reading "image/png" on ClipboardItem
Summary: [Clipboard API] Support reading "image/png" on ClipboardItem
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: HTML Editing (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Wenson Hsieh
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-05-24 23:02 PDT by Wenson Hsieh
Modified: 2020-05-27 12:50 PDT (History)
5 users (show)

See Also:


Attachments
For EWS (48.60 KB, patch)
2020-05-25 12:26 PDT, Wenson Hsieh
no flags Details | Formatted Diff | Diff
For EWS (47.00 KB, patch)
2020-05-25 12:26 PDT, Wenson Hsieh
no flags Details | Formatted Diff | Diff
For EWS (49.19 KB, patch)
2020-05-25 12:40 PDT, Wenson Hsieh
thorton: review+
Details | Formatted Diff | Diff
Patch for landing (49.18 KB, patch)
2020-05-27 12:19 PDT, Wenson Hsieh
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Wenson Hsieh 2020-05-24 23:02:52 PDT
Support reading "image/png" on ClipboardItem
Comment 1 Radar WebKit Bug Importer 2020-05-24 23:03:18 PDT
<rdar://problem/63588957>
Comment 2 Wenson Hsieh 2020-05-25 12:26:27 PDT Comment hidden (obsolete)
Comment 3 Wenson Hsieh 2020-05-25 12:26:47 PDT Comment hidden (obsolete)
Comment 4 Wenson Hsieh 2020-05-25 12:40:54 PDT
Created attachment 400216 [details]
For EWS
Comment 5 Tim Horton 2020-05-27 11:38:52 PDT
Comment on attachment 400216 [details]
For EWS

View in context: https://bugs.webkit.org/attachment.cgi?id=400216&action=review

> Source/WebCore/Modules/async-clipboard/mac/ClipboardImageReaderMac.mm:41
> +        if (auto bitmapData = retainPtr([image TIFFRepresentation])) {
> +            auto bitmapRepresentation = adoptNS([[NSBitmapImageRep alloc] initWithData:bitmapData.get()]);
> +            m_result = Blob::create(SharedBuffer::create([bitmapRepresentation representationUsingType:NSBitmapImageFileTypePNG properties:@{ }]), m_mimeType);

I provided a potential alternative to this double-encode offline.
Comment 6 Wenson Hsieh 2020-05-27 11:40:12 PDT
Comment on attachment 400216 [details]
For EWS

View in context: https://bugs.webkit.org/attachment.cgi?id=400216&action=review

>> Source/WebCore/Modules/async-clipboard/mac/ClipboardImageReaderMac.mm:41
>> +            m_result = Blob::create(SharedBuffer::create([bitmapRepresentation representationUsingType:NSBitmapImageFileTypePNG properties:@{ }]), m_mimeType);
> 
> I provided a potential alternative to this double-encode offline.

👍🏻 Giving it a try, thanks!
Comment 7 Wenson Hsieh 2020-05-27 12:19:13 PDT
Created attachment 400365 [details]
Patch for landing
Comment 8 EWS 2020-05-27 12:50:46 PDT
Committed r262209: <https://trac.webkit.org/changeset/262209>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 400365 [details].