GenericError when creating certain QR Codes
Posted: Fri Feb 03, 2017 6:06 pm
Hi,
we are experiencing random problems since we switched to GdPicture generated QR Codes.
The following strings produce an error, when we try to generate a QR Code for them: "XV 068KWU98265743", "FC 468XGJ12904250", "GO 359DAJ94366606", "JX 419TPJ81182933", "WY 625DJN16336771", "KX 002AET53587905", "PO 682UHA01218105", "IY 368LIW15828283", "AJ 703KMC45691816", "OO 645YCV87079367", "GJ 802XER79431857".
What happens is that the BarcodeQRWrite function sets GetStat to GdPictureStatus.GenericError. Moreover, the debug output window in Visual Studio shows that an IndexOutOfRange Exception is thrown somewhere inside GdPicture.
Here is code to reproduce the error:
Please let me know whether this is a Bug in GdPicture or whether there is a problem in our use of the GdPicture API.
Best,
acl
we are experiencing random problems since we switched to GdPicture generated QR Codes.
The following strings produce an error, when we try to generate a QR Code for them: "XV 068KWU98265743", "FC 468XGJ12904250", "GO 359DAJ94366606", "JX 419TPJ81182933", "WY 625DJN16336771", "KX 002AET53587905", "PO 682UHA01218105", "IY 368LIW15828283", "AJ 703KMC45691816", "OO 645YCV87079367", "GJ 802XER79431857".
What happens is that the BarcodeQRWrite function sets GetStat to GdPictureStatus.GenericError. Moreover, the debug output window in Visual Studio shows that an IndexOutOfRange Exception is thrown somewhere inside GdPicture.
Here is code to reproduce the error:
Code: Select all
Dim data = "XV 068KWU98265743"
Using imagingApi As New GdPicture9.GdPictureImaging
Dim size = imagingApi.BarcodeQRGetSize(data.ToUpper, GdPicture9.BarcodeQREncodingMode.BarcodeQREncodingModeAlphaNumeric, GdPicture9.BarcodeQRErrorCorrectionLevel.BarcodeQRErrorCorrectionLevelH, 0, 0, 10)
Dim imageId = imagingApi.CreateNewGdPictureImage(size, size, Drawing.Imaging.PixelFormat.Format24bppRgb, Drawing.Color.White)
If imagingApi.BarcodeQRWrite(imageId,
data.ToUpper,
GdPicture9.BarcodeQREncodingMode.BarcodeQREncodingModeAlphaNumeric,
GdPicture9.BarcodeQRErrorCorrectionLevel.BarcodeQRErrorCorrectionLevelH,
0, 0, 10,
0, 0, 0,
Drawing.Color.Black,
Drawing.Color.White) <> GdPicture9.GdPictureStatus.OK _
OrElse imagingApi.GetStat <> GdPicture9.GdPictureStatus.OK Then
Debugger.Break()
End If
imagingApi.ReleaseGdPictureImage(imageId)
End Using
Best,
acl