Skip to content

Commit 60d59f9

Browse files
committed
Update README
1 parent aba6b96 commit 60d59f9

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,12 @@ tinify.fromFile("unoptimized.png").resize({
5858
}).toFile("thumbnail.jpg");
5959

6060
// Convert format
61-
tinify.fromFile("photo.jpg").convert({ type: ["image/webp", "image/png"] })
62-
.result().extension().then(ext => {
63-
return tinify.fromFile("photo.jpg").toFile("photo." + ext);
64-
});
61+
const source = tinify.fromFile("panda-sticker.jpg");
62+
const converted = source.convert({type:["image/webp","image/png"]});
63+
const extension = converted.result().extension();
64+
extension.then(ext => {
65+
converted.toFile("panda-sticker." + ext);
66+
})
6567

6668
// Preserve metadata
6769
tinify.fromFile("original.jpg")

0 commit comments

Comments
 (0)