Skip to content

Commit 3fe8328

Browse files
committed
clean
1 parent b1cdf0b commit 3fe8328

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

www/utils/screenshot.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ if (parsedUrl.protocol !== "http:" && parsedUrl.protocol !== "https:") {
1111
throw new Error("Invalid URL");
1212
}
1313

14-
const outDir = new URL("../static/showcase", import.meta.url);
1514
const browser = await puppeteer.launch({
1615
defaultViewport: { width: 1200, height: 675 },
1716
headless: true,
@@ -23,9 +22,9 @@ await browser.close();
2322

2423
// convert to jpeg
2524
const image2x = await Image.decode(raw);
26-
const jpeg2x = new URL(`./${id}2x.jpg`, outDir);
25+
const jpeg2x = import.meta.resolve(`../static/showcase/${id}2x.jpg`);
2726
await Deno.writeFile(jpeg2x, await image2x.encodeJPEG(80));
2827

29-
const jpeg1x = new URL(`./${id}1x.jpg`, outDir);
28+
const jpeg1x = import.meta.resolve(`../static/showcase/${id}1x.jpg`);
3029
const image1x = image2x.resize(image2x.width / 2, Image.RESIZE_AUTO);
3130
await Deno.writeFile(jpeg1x, await image1x.encodeJPEG(80));

0 commit comments

Comments
 (0)