Recent

Author Topic: LazBarcodes PDF417 bug  (Read 3040 times)

dseligo

  • Hero Member
  • *****
  • Posts: 1246
LazBarcodes PDF417 bug
« on: April 08, 2024, 12:50:59 pm »
There is something wrong with the creation of the barcode PDF417 from the package LazBarcodes.
With greater text length, symbol becomes unreadable and garbled.

I tried to create text with all characters being '1' at different lengths.
When length is 218 characters, symbol starts to deform (although it is still readable).
After length of 302 characters, symbol is unreadable, and at length of 366 characters symbol is all garbled.

Depending on the text, this artifacts can start to show even with less characters.

I am attaching test project and created images.

Is this a known issue? And if it is, is there a solution?

Lazarus 3.2, FPC 3.2.2, W11

This is test program:
Code: Pascal  [Select][+][-]
  1. program TestPDF417;
  2.  
  3. uses SysUtils, Interfaces, Graphics, ubarcodes;
  4.  
  5. procedure CreatePDF417(ASymbolLength: Integer);
  6. var Barcode: TBarcodePDF417;
  7. begin
  8.   Barcode := TBarcodePDF417.Create(nil);
  9.   try
  10.     Barcode.Text := StringOfChar('1', ASymbolLength);
  11.     Barcode.SaveToFile('x' + ASymbolLength.ToString + '.png', TPortableNetworkGraphic);
  12.   finally
  13.     Barcode.Free;
  14.   end;
  15. end;
  16.  
  17. begin
  18.   CreatePDF417(217); // symbol OK
  19.   CreatePDF417(218); // something strange with line on the right side, but readable
  20.   CreatePDF417(302); // symbol is not readable
  21.   CreatePDF417(366); // symbol is totally garbled
  22. end.

dseligo

  • Hero Member
  • *****
  • Posts: 1246
Re: LazBarcodes PDF417 bug
« Reply #1 on: April 09, 2024, 02:25:07 pm »

wp

  • Hero Member
  • *****
  • Posts: 12031
Re: LazBarcodes PDF417 bug
« Reply #2 on: April 09, 2024, 03:11:33 pm »
I am working on it. The issue is in two options which are available in the Zint library, but are ignored in LazBarCodes.

dseligo

  • Hero Member
  • *****
  • Posts: 1246
Re: LazBarcodes PDF417 bug
« Reply #3 on: April 09, 2024, 04:43:12 pm »
I am working on it. The issue is in two options which are available in the Zint library, but are ignored in LazBarCodes.

Great, thank you

wp

  • Hero Member
  • *****
  • Posts: 12031
Re: LazBarcodes PDF417 bug
« Reply #4 on: April 11, 2024, 08:06:22 pm »
Fixed in the ccr version.

dseligo

  • Hero Member
  • *****
  • Posts: 1246
Re: LazBarcodes PDF417 bug
« Reply #5 on: April 12, 2024, 02:47:46 am »
Fixed in the ccr version.

Thank you. :)

I tested it, it is working great!

 

TinyPortal © 2005-2018