From 99ae37aac6d7b4b6d2e1f1c49626657aa4a28022 Mon Sep 17 00:00:00 2001 From: songsenand Date: Sat, 24 Dec 2022 17:20:27 +0800 Subject: [PATCH] feat(ImageShow.svelte): some handle like image rotate and resize but not complete BREAKING CHANGE: --- src/lib/ImageShow.svelte | 98 ++++++++++++++++++++++++++++------------ src/lib/utils.js | 17 +------ 2 files changed, 71 insertions(+), 44 deletions(-) diff --git a/src/lib/ImageShow.svelte b/src/lib/ImageShow.svelte index a9ec4c3..b304c8a 100644 --- a/src/lib/ImageShow.svelte +++ b/src/lib/ImageShow.svelte @@ -1,16 +1,13 @@
diff --git a/src/lib/utils.js b/src/lib/utils.js index 255e55a..5899611 100644 --- a/src/lib/utils.js +++ b/src/lib/utils.js @@ -1,7 +1,5 @@ import procedure from "../assets/Procedure.json"; -const jimp = window.jimp; - export function Operation(step) { this.step = step; @@ -27,17 +25,4 @@ export function Operation(step) { this.get_color = () => { return procedure.find((e) => e.id === this.step).color; }; -} - -export function ImageProcessing() { - this.init_image = async (url) => { - const image = await jimp.read(url); - return image.getBase64Async(jimp.MIME_PNG); - }; - - this.rotate = async (url, angle) => { - const image = await jimp.read(url); - image.rotate(angle); - return image.getBase64Async(jimp.MIME_PNG); - }; -} +} \ No newline at end of file