feat(clipboard): support readImage & writeImage#845
feat(clipboard): support readImage & writeImage#845lucasfernog merged 18 commits intotauri-apps:v2from cijiugechu:feat/clipboard-image
readImage & writeImage#845Conversation
read_image & write_imagereadImage & writeImage
|
I wish we had 1Password/arboard#103 :( |
|
New and removed dependencies detected. Learn more about Socket for GitHub ↗︎
🚮 Removed packages: npm/@tauri-apps/api@2.0.0-beta.4, npm/@tauri-apps/cli@2.0.0-beta.7 |
| * ``` | ||
| * @since 2.0.0 | ||
| */ | ||
| async function readImage(): Promise<ClipboardImage<Uint8Array>> { |
There was a problem hiding this comment.
this should return an instance of Image from @tauri-apps/image
There was a problem hiding this comment.
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...
There was a problem hiding this comment.
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.
|
Just waiting on the next tauri release to push the image changes :) |
Co-authored-by: Amr Bashir <amr.bashir2015@gmail.com>
Co-authored-by: Amr Bashir <amr.bashir2015@gmail.com>
related issue: