mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-04-23 11:36:13 +02:00
9dec9605ed
* feat(clipboard): support `read_image` & `write_image` * fix plugin name * platform specific bahavior * remove unnecessary BufWriter * improvement * update example * update example * format * header, fix change file * use image from tauri * fix ci * update tauri, fix read * image crate only on desktop [skip ci] * Update plugins/authenticator/src/u2f_crate/protocol.rs [skip ci] Co-authored-by: Amr Bashir <amr.bashir2015@gmail.com> * Update plugins/authenticator/src/u2f_crate/protocol.rs [skip ci] Co-authored-by: Amr Bashir <amr.bashir2015@gmail.com> * update deps, address code review * fix mobile [skip ci] --------- Co-authored-by: Lucas Nogueira <lucas@tauri.studio> Co-authored-by: Lucas Nogueira <lucas@tauri.app> Co-authored-by: Amr Bashir <amr.bashir2015@gmail.com>
16 lines
480 B
JavaScript
16 lines
480 B
JavaScript
// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
export function arrayBufferToBase64(buffer, callback) {
|
|
const blob = new Blob([buffer], {
|
|
type: "application/octet-binary",
|
|
});
|
|
const reader = new FileReader();
|
|
reader.onload = function (evt) {
|
|
const dataurl = evt.target.result;
|
|
callback(dataurl.substr(dataurl.indexOf(",") + 1));
|
|
};
|
|
reader.readAsDataURL(blob);
|
|
}
|