Correctly return image buffer to resolve #2124

This commit is contained in:
GCHQDeveloper581 2025-10-17 19:27:25 +00:00
parent c4d19e5fdd
commit cbad5ac0fe
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": case "PDF":
return Utils.strToArrayBuffer(qrImage); return Utils.strToArrayBuffer(qrImage);
case "PNG": case "PNG":
return qrImage.buffer; return qrImage.buffer.slice(qrImage.byteOffset, qrImage.byteLength + qrImage.byteOffset);
default: default:
throw new OperationError("Unsupported QR code format."); throw new OperationError("Unsupported QR code format.");
} }