Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Moebits committed Sep 6, 2024
1 parent 2e89b7c commit 6aa6db3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
8 changes: 2 additions & 6 deletions main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,8 @@ const saveImage = async (image: any, savePath: string) => {
functions.downloadImage(image, savePath)
} else {
if (image.startsWith("data:")) image = functions.base64ToBuffer(image)
if (image === savePath) {
const buffer = await sharp(image).toBuffer()
fs.writeFileSync(savePath, buffer)
} else {
sharp(image).toFile(savePath)
}
if (image === savePath) image = fs.readFileSync(image)
sharp(image).toFile(savePath)
}
}

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "photo-viewer",
"version": "0.2.3",
"version": "0.2.4",
"description": "An image/GIF viewer that can apply various resizing and color effects.",
"main": "dist/main.js",
"scripts": {
Expand Down

0 comments on commit 6aa6db3

Please sign in to comment.