fix(nextjs): parses width height to int for sharp svg to png

This commit is contained in:
sauravniraula 2025-07-26 02:26:44 +05:45
parent df90b7829c
commit e07a04ba6a
No known key found for this signature in database
GPG key ID: 60FCC1B5A5E83326

View file

@ -179,7 +179,7 @@ const convertSvgToPng = async (element_attibutes: ElementAttributes) => {
const svgBuffer = Buffer.from(svgHtml);
const pngBuffer = await sharp(svgBuffer)
.resize(element_attibutes.position?.width ?? 10, element_attibutes.position?.height ?? 10)
.resize(Math.round(element_attibutes.position?.width ?? 10), Math.round(element_attibutes.position?.height ?? 10))
.toFormat('png')
.toBuffer();
return pngBuffer;