Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(clipboard): support readImage & writeImage #845

Merged
merged 18 commits into from
Mar 19, 2024

Conversation

cijiugechu
Copy link
Contributor

@cijiugechu cijiugechu requested a review from a team as a code owner December 21, 2023 10:52
@cijiugechu cijiugechu changed the title feat(clipboard): support read_image & write_image feat(clipboard): support readImage & writeImage Dec 21, 2023
plugins/clipboard-manager/src/mobile.rs Outdated Show resolved Hide resolved
plugins/clipboard-manager/src/commands.rs Show resolved Hide resolved
plugins/clipboard-manager/src/desktop.rs Outdated Show resolved Hide resolved
plugins/clipboard-manager/src/desktop.rs Outdated Show resolved Hide resolved
plugins/clipboard-manager/Cargo.toml Show resolved Hide resolved
@lucasfernog
Copy link
Member

I wish we had 1Password/arboard#103 :(

lucasfernog
lucasfernog previously approved these changes Mar 7, 2024
Copy link

socket-security bot commented Mar 9, 2024

New and removed dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
npm/@tauri-apps/[email protected] None 0 542 kB tauri-apps-ci-user
npm/@tauri-apps/[email protected] filesystem, shell 0 212 kB tauri-apps-ci-user

🚮 Removed packages: npm/@tauri-apps/[email protected], npm/@tauri-apps/[email protected]

View full report↗︎

plugins/clipboard-manager/Cargo.toml Show resolved Hide resolved
* ```
* @since 2.0.0
*/
async function readImage(): Promise<ClipboardImage<Uint8Array>> {
Copy link
Member

Choose a reason for hiding this comment

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

this should return an instance of Image from @tauri-apps/image

Copy link
Member

Choose a reason for hiding this comment

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

in this case we already have the bytes/width/height and the Image class does note expose an API to directly create an image from those values.. doesn't make much sense to send them back to the rust side...

Copy link
Member

Choose a reason for hiding this comment

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

The Image class should be constructed on the Rust side then added to the resources_table, we only return an RresourceId to JS and construct the Js Image class with it.

@lucasfernog
Copy link
Member

Just waiting on the next tauri release to push the image changes :)

@lucasfernog lucasfernog merged commit 9dec960 into tauri-apps:v2 Mar 19, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants