Skip to content

Commit 6aa6db3

Browse files
committed
fixes
1 parent 2e89b7c commit 6aa6db3

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

main.ts

+2-6
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,8 @@ const saveImage = async (image: any, savePath: string) => {
4444
functions.downloadImage(image, savePath)
4545
} else {
4646
if (image.startsWith("data:")) image = functions.base64ToBuffer(image)
47-
if (image === savePath) {
48-
const buffer = await sharp(image).toBuffer()
49-
fs.writeFileSync(savePath, buffer)
50-
} else {
51-
sharp(image).toFile(savePath)
52-
}
47+
if (image === savePath) image = fs.readFileSync(image)
48+
sharp(image).toFile(savePath)
5349
}
5450
}
5551

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "photo-viewer",
3-
"version": "0.2.3",
3+
"version": "0.2.4",
44
"description": "An image/GIF viewer that can apply various resizing and color effects.",
55
"main": "dist/main.js",
66
"scripts": {

0 commit comments

Comments
 (0)