File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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 ) ;
1514const 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
2524const 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` ) ;
2726await 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` ) ;
3029const image1x = image2x . resize ( image2x . width / 2 , Image . RESIZE_AUTO ) ;
3130await Deno . writeFile ( jpeg1x , await image1x . encodeJPEG ( 80 ) ) ;
You can’t perform that action at this time.
0 commit comments