-
Notifications
You must be signed in to change notification settings - Fork 404
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Barcode Generated looks weird JPG,PNG #204
Comments
I encountered this issue as well. Just keeping the width factor >=2 works. |
What is the value that you put into the barcode? In the example, what is coming out of |
@casperbakker A string of random numbers like "0123456789" should technically work for reproducing this issue. The issue really was that the thinner lines did not render for some reason, only the thicker ones, although on my local environment I have been unable to reproduce that. And as mentioned previously, just using a width factor that is >= 2 worked for me. The issue was on Magento Cloud in my case. |
Weird. I think it can only be something in the way GD or Imagick was build on that machine. Maybe the quality of the JPG rendering was overruled to be lower quality? This is on my machine. On the top rendered with 1 as width, the bottom one with 2. If the JPG gives you problems, you can try to use the PNG renderer. As PNG has no way to compress the image and loose small lines to make the file smaller. |
Surprisingly, this happened both with png and jpg renderers during my testing. AFAIK it was with the gd renderer there, didn’t test adding imagick. Are there any tests that could help here? |
@edvardsr Could you dump the data from the I also just released version 3 of this library with some optimisations. You could also try to use that and see if the results are different. |
I’ll give the new version a try later today, will report back with findings roughly before this time tomorrow. |
Hi @casperbakker, This is what is happening with the new version (3.1.0) on the cloud environment. This is the code I used:
To compare, this is what I have on my local setup: Here is a var_dump of the $barcode variable on the cloud environment. For the record, it seems almost identical to the one on my local setup except for the # numbers, so the issue has to be somewhere else probably. https://gist.github.com/edvardsr/eb8a5a1b2745db66eb785f4822d0e9e1 |
The GD version on the cloud instance is "bundled (2.1.0 compatible)", so potentially it might be possible to reproduce the issue with this version of GD. Imagick isn't installed, and the PHP version is 8.3.7. The version of GD on my local setup is 2.3.3, and the version of imagick is 3.7.0. I have been unable to reproduce the issue with those versions. |
Hey guys, does anyone ever meet this problem?
the barcode generated looks weird
this is the code to generate it
$generator = new \Picqer\Barcode\BarcodeGeneratorJPG();
file_put_contents('media/barcode.jpg', $generator->getBarcode($invoice->getIncrementId(), $generator::TYPE_CODE_39, 1, 50, [0, 0, 0]));
It works normal on local but works weird on cloud env.
Please assist
The text was updated successfully, but these errors were encountered: