Correctly return image buffer to resolve #2124

This commit is contained in:
GCHQDeveloper581 2025-10-17 19:27:25 +00:00
parent 74013dd343
commit 8ac26646f3
No known key found for this signature in database
GPG key ID: 6222E059A3DF595C

View file

@ -86,7 +86,7 @@ export function generateQrCode(input, format, moduleSize, margin, errorCorrectio
case "PDF":
return Utils.strToArrayBuffer(qrImage);
case "PNG":
return qrImage.buffer;
return qrImage.buffer.slice(qrImage.byteOffset, qrImage.byteLength + qrImage.byteOffset);
default:
throw new OperationError("Unsupported QR code format.");
}