Skip to content
This repository has been archived by the owner on Feb 9, 2023. It is now read-only.

feat(QClipboardProxy): add support for images, html and urls #76

Merged
merged 1 commit into from
Nov 25, 2022

Conversation

0x-r4bbit
Copy link
Member

@0x-r4bbit 0x-r4bbit commented Nov 24, 2022

  • also add discovery properties (hasText/hasImage/hasHtml/hasUrls)
  • support for image format is also provided as base64 encoded byte array wrapper

Related: status-im/status-desktop#3395

@caybro caybro force-pushed the feat/clipboard-image-base64 branch from 4adde95 to 79f391b Compare November 24, 2022 14:57
@caybro caybro marked this pull request as draft November 24, 2022 14:58
@caybro caybro force-pushed the feat/clipboard-image-base64 branch from 79f391b to 7d3513d Compare November 24, 2022 15:06
@0x-r4bbit 0x-r4bbit force-pushed the feat/clipboard-image-base64 branch from 7d3513d to 7621c10 Compare November 24, 2022 16:37
@caybro caybro force-pushed the feat/clipboard-image-base64 branch from 7621c10 to 984e6a0 Compare November 24, 2022 21:21
@caybro caybro changed the title WIP: add imageBase64 to ClipboardProxy feat(QClipboardProxy): add support for images, html and urls Nov 24, 2022
@caybro caybro marked this pull request as ready for review November 24, 2022 21:25
const auto img = image();
QByteArray byteArray;
QBuffer buffer(&byteArray);
img.save(&buffer, "PNG"); // writes the image in PNG format inside the buffer
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we determine whether we really have a PNG? This could be JPG or WEBP as well

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here we always save as PNG but we could yeah, TODO :)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be problematic for GIFs... we would effectively kill the animation :/

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW I don't think we support sending GIFs as image messages atm

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I stand corrected. It looks like we do

@0x-r4bbit
Copy link
Member Author

@caybro did the heavy-lifting here. Thank you!

@0x-r4bbit 0x-r4bbit merged commit 4dfe2d9 into master Nov 25, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants