picqer / php-barcode-generator

Barcode generator in PHP that is easy to use, non-bloated and framework independent.
GNU Lesser General Public License v3.0
1.66k stars 400 forks source link

Barcode output is different deppends on server #155

Closed JoaoVictorSarzi closed 2 years ago

JoaoVictorSarzi commented 2 years ago

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...

casperbakker commented 2 years ago

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.

pascalniklaspaul commented 1 year ago

@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?

casperbakker commented 1 year ago

@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.

pascalniklaspaul commented 1 year ago

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)

JoaoVictorSarzi commented 1 year ago

@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

JoaoVictorSarzi commented 1 year ago

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!