Skip to content
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

ITF barcode is not decoded in tiff image, but decoded in JPG image #512

Open
SanKumSan opened this issue Jul 18, 2023 · 7 comments
Open

Comments

@SanKumSan
Copy link

I have an ITF barcode with 10 digits value.

When an scanned tiff image with ITF barcode, tried to decode this barcode, NO value is decoded.
But the same image, when scanned as JPG, and tried to decode, it is decoded successfully.

I am wondering why the image format, tiff or jpeg, effects the decoding of this ITF value.
Any inputs are appreciated.

@micjahn
Copy link
Owner

micjahn commented Jul 18, 2023

Can you provide the JPG and TIFF files?

@SanKumSan
Copy link
Author

sample_Jpeg
Here is a jpeg sample image with ITF barcode and it is decoded.

@SanKumSan
Copy link
Author

SanKumSan commented Jul 19, 2023

https://github.com/SanKumSan/testercr7/blob/main/sample_tiff.tif

Here is the tiff file with the same ITF barcode and it is not decoded by ZXing.

Note : Tiff has LZW compression.

Does the compression of the tiff effects the decoding behaviour ?

Does the image formats (tiff, jpeg, png and others) effects the decoding behaviour ?

@SanKumSan
Copy link
Author

Hello @micjahn ,

Are you able decode the sample tiff file for ITF barcode ?
Thanks

@micjahn
Copy link
Owner

micjahn commented Jul 26, 2023

Sorry, I can't check it for the next three weeks.
Anyway, the file format doesn't affect the decoding success. Internally every image format is converted to Bitmap before decoding. Only the compression algorithm of the format can in some cases affect the bitmap quality (difference between lossless and not lossless compression).

@SanKumSan
Copy link
Author

Thanks @micjahn . Thanks for the answers.

@micjahn
Copy link
Owner

micjahn commented Aug 22, 2023

I couldn't decode both of them if I used the original image size.
If I reduce the size to 75% both versions are successfully decoded.
I think the main problem is more or less the black-and-white ratio of the image and the pixel artifacts in the black areas.
Perhaps a real-world image with more content would give better results. Or you generally shrink the scanned image by 25% before decoding which reduces artifacts in the black areas.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants