Closed leobg closed 6 years ago
I can confirm this; arguing with the same issue myself
I can also confirm that switching from GD to imagemagick makes no difference. And neither does turning the printer up to super-uber-fine quality
Can you show me an example of an affected barcode?
(We are able to scan the barcodes on the demo, using a bluetooth barcoce scanner, so we cannot really reproduce this issue.)
If you print it on a label most scanners won't read it.
Admittedly I'm currently printing to a laser printer; still waiting for my proper label printer to arrive. Am about to try printing to a normal Dymo label printer in a little while. Once ive done that, I'll try and post up some sample, although it's hard when its on paper :)
As I reported originally, QR codes look and work perfect. Non-QR codes are generated with grayscale gradations which makes print output especially on a low resolution bar code printer looking fuzzy and unreadable by a common barcode scanner (such as older Motorola symbols). I ended up generating the labels in dedicated barcode software until snipeit is fixed.
This may sound dumb, but maybe post a photo of the printed result? Every time we modify the barcodes, we print out several pages of them and make sure that they still scan properly, so it's hard for me to reproduce this. (Our printer is nothing fancy, B&W HP Laserjet P 1102W.)
I gotta say, it looks fine, but zooming on the photos it does kinda look fuzzy. I should also point out that the scanner works fine on any other barcode I can find kicking around my office.
Just for giggles, I tried from Safari (instead of FFox), thinking it may be the browsers print engine - nada.
if its helpful; its running on a Debian 8 server. Installed using install.sh Attached is the phpinfo (its not publicly accessible.) phpinfo.pdf
@snipe - just to lay one other possibility to rest - what browser are you using for your testing? Mac/PC? Just so I can try and replicate your 'working' situation.
I've used Chrome and Safari on OSX
Nut's - there goes that theory. Although it does take one possibility (the client end) out of the equation.
Update - tried Chrome (the only browser I hadnt) - negative, ghostrider. Update, pt2 - ditto IE on Win 7.
Got my label printer. Issue is more obvious
@snipe - I really am sorry for spamming this thread, but I kinda figured more info is better than none.
For the sake of it, I File --> Print --> Save as PDF. You can really see the grey edges now.
@jason - thanks for posting all pics. This is exactly the issue I reported. QR codes are not affected, only linear ones. When you print this on a 200dpi BW label printer on a 1 inch wide label result is unscannable barcode.
The easiest way to check is just pick an asset, hit generate labels with a 1D, and zoom to 500% on browser. The 1D barcode image gets very fuzzy as oppose to the text or the label border.
Or access directly via /hardware/[ID]/barcode then zoom 500%.
I wonder if it could php-GD doing some kind of anti-aliasing?
Just did a bit more testing and there appears to be a hard coded width of 250px which is stretching out the bars causing the difficulty reading on some devices, if i remove this limit and let the width generate dynamically the barcodes are reading almost instantaneously across all our devices.
There is a risk that a very long name will stretch over the label though.
@BrettFagerlund How did you do this? I'd like to give it a go?
@Jason-Weber-UC first go into the public/uploads/barcodes folder and clean out the existing barcodes, it will use the images if they already exist so you need to clear it to regenerate.
Then go to app\http\controllers\assetscontroller.php Find the function getBarCode Inside that function there will be a line
$barcode_obj = $barcode->getBarcodeObj($settings->alt_barcode, $asset->asset_tag, 250, 20);
replace the 250 with '' (2 apostrophes) so it will be like
$barcode_obj = $barcode->getBarcodeObj($settings->alt_barcode, $asset->asset_tag, '', 20);
DING!!! Brilliant.
@jason does this patch solve the 2d barcodes fuzziness?
@leobg I still have a bit of fuzziness on the barcodes, but the readability is a lot better since the bars are not being stretched out.
Not sure how much more can be done without switching over to svg. I've also added in custom css to fix the zooming and make it look cleaner but it seems to always print a bit fuzzy regardless of how it looks on screen.
Put it this way - can now scan them. SO for me at least - Problem solved.
Whats this CSS file?
its kinda unncessary, but once logged in I went to options and added the following into the custom css box
img.barcode {
image-rendering: pixelated;
}
It will just stop the browser messing with the image on zoom (well for chrome anyway)
I just tried with the resize hack Brett suggested, but I can't say it really addresses the problem. Bar code is no longer stretched along the length of the label, but rather on the middle. Still fuzzy. I am no programmer, but I am curious if possible to use the same approach as for QR codes (which are drawn perfectly) for line bar codes?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions!
Expected Behavior (or desired behavior if a feature request)
non-QR barcodes to be generated in black and white (no gray scale gradations just like QR codes)
Actual Behavior
non-QR (C39/C128....) barcode lines are not sharp (instead B/W it uses gray scale/smudging) which makes them pretty much non-scannable. QR codes are OK.
Please confirm you have done the following before posting your bug report:
Please provide answers to these questions before posting your bug report:
app/storage/logs
and your webserver's logs.