zxingify / zxingify-objc

An Objective-C Port of ZXing
Apache License 2.0
3.06k stars 753 forks source link

Scanner doesn't detect ITF with length above 30+ #29

Closed mobinauten closed 11 years ago

mobinauten commented 11 years ago

Scanner doesn't detect ITF with lengths above 30+ characters, especially the braslian 44 payment ITF.

Results are unpredictable - tested with this code generator http://www.racoindustries.com/barcodegenerator/1d/interleaved-2-of-5.aspx

cwalcott commented 11 years ago

Only ITFs of specific lengths are allowed: 44, 24, 20, 18, 16, 14, 12, 10, 8, 6. 44's should work, but I believe something's wrong with that code generator: If I try try to encode "12345678901234567890123456789012345678901234", the resulting barcode is "123456789012345678901234567890123456789012348" (with an 8 at the end).

azimonti commented 11 years ago

hello (I had a similar case before :) ) the generator is good :). the last digit is just a check digit. you can verify it here http://www.axicon.com/checkdigitcalculator.html if you put '1234567123456' and select ITF-14 is giving you '12345671234565' which is the same result as the generator in the original post. For ITF (I think) that is not strictly necessary, but the site might assume that you pass a length n-1 and it computes for you the last digit.

cwalcott commented 11 years ago

Ah, thank you, I don't know much about ITF codes. In that case, it looks like 44s are decoding OK. I confirmed that this barcode was able to decode:

http://www.racoindustries.com/barcodegenerator/1d/barcode-image.axd?S=Interleaved2of5&AC=T&BH=1&BW=0.02&BBS=None&BM=0.25&C=1234567890123456789012345678901234567890123&DCHK=T&DC=T&IFMT=Gif&QZ=0.25&TM=0.25

I suspect it's difficult to scan because of the awkward dimensions (much wider than tall).