picqer/php-barcode-generator

Barcode output is different deppends on server

JoaoVictorSarzi opened this issue · 6 comments

I have to migrate my application to another server and i saw a difference on barcode:

Before:
barcode-febore

After:
barcode-after

PHP:
$generatorBarcode = new BarcodeGeneratorPNG();
$barcode = $generatorBarcode->getBarcode($produto->getCodigo(), $generatorBarcode::TYPE_CODE_128, 1, 30);
$barcodeHtml = '';

How can i fix this. Now i cant read this barcode...

There should be a difference in the output of $produto->getCodigo() on those 2 servers. It is highly unlikely this is caused by this library itself.

@casperbakker We have the same issue and can assure that we use the same number to generate the barcode. Do you have any other idea which could cause this problem?

@pascalniklaspaul Can you provide as much information as possible? At least I need the data inputed into the first variable of getBarcode(), in Joao's case $produto->getCodigo(). I need what data that gave on the old and new server.

TYPE_CODE_128 is the most used type of this package, with millions of installs. It can be, but it would be highly unlikely that this package gives you a different barcode image with the exact same input only based on another server.

We investigated this further and found out that it is a specific imagemagic version which causes this behavior. (ImageMagick 6.9.10-23 Q16 x86_64 20190101)

@pascalniklaspaul Can you provide as much information as possible? At least I need the data inputed into the first variable of getBarcode(), in Joao's case $produto->getCodigo(). I need what data that gave on the old and new server.

TYPE_CODE_128 is the most used type of this package, with millions of installs. It can be, but it would be highly unlikely that this package gives you a different barcode image with the exact same input only based on another server.

Only numbers, like 1, 100, 2000

We investigated this further and found out that it is a specific imagemagic version which causes this behavior. (ImageMagick 6.9.10-23 Q16 x86_64 20190101)

I will try to chagne the ImageMagick version. Thanks!