tangled
alpha
login
or
join now
ptr.pet
/
endpoint
0
fork
atom
data endpoint for entity 90008 (aka. a website)
0
fork
atom
overview
issues
pulls
pipelines
try 'destroying' the sharp instances and konva stage
ptr.pet
2 months ago
2168e947
fa934c85
verified
This commit was signed with the committer's
known signature
.
ptr.pet
SSH Key Fingerprint:
SHA256:Abmvag+juovVufZTxyWY8KcVgrznxvBjQpJesv071Aw=
0/0
Waiting for spindle ...
+11
-4
1 changed file
expand all
collapse all
unified
split
eunomia
src
lib
constellation.ts
+11
-4
eunomia/src/lib/constellation.ts
reviewed
···
606
606
const sharpImg = await (stage.toCanvas() as unknown as Canvas).toSharp();
607
607
const buffer = await sharpImg.webp({ effort: 6, quality: 30, smartDeblock: true }).toBuffer();
608
608
await writeFile(DUST_FILE, buffer);
609
609
+
sharpImg.destroy();
610
610
+
611
611
+
stage.destroyChildren();
612
612
+
stage.destroy();
609
613
610
614
const projected: Record<string, ProjectedTrans> = {};
611
615
···
749
753
console.log('generating OG image...');
750
754
(async () => {
751
755
const h = 630;
752
752
-
const resized_svg = await sharp(OUTPUT_FILE).resize({ height: h }).toBuffer();
753
753
-
sharp(DUST_FILE)
756
756
+
const s = sharp(OUTPUT_FILE).resize({ height: h })
757
757
+
const resized_svg = await s.toBuffer();
758
758
+
const og = sharp(DUST_FILE)
754
759
.resize({ height: h })
755
760
.composite([{ input: resized_svg }])
756
756
-
.png()
757
757
-
.toFile(OG_IMAGE_FILE);
761
761
+
.png();
762
762
+
await og.toFile(OG_IMAGE_FILE);
763
763
+
s.destroy();
764
764
+
og.destroy();
758
765
})();
759
766
760
767
console.log(`rendered constellation in ${Date.now() - start}ms`);