openfoodfacts / openfoodfacts-ios

Native (Swift) version of Open Food Facts for iOS. Coders & Decoders welcome 🤳🥫 😊
https://ios.openfoodfacts.org
Apache License 2.0
361 stars 160 forks source link

Support for Code 128 Barcodes #563

Open bredowmax opened 4 years ago

bredowmax commented 4 years ago

Summary: Some products (mostly freshly packaged products with varying weight or price) have Code 128 barcodes that the OFF app does not currently support. The Scandit app does find it

Screenshots:

Screenshot 2020-02-01 at 16 08 58

What is Code 128? https://en.wikipedia.org/wiki/Code_128

Slack https://openfoodfacts.slack.com/archives/C02SSQ02N/p1580590985010200

bredowmax commented 4 years ago

Another example, this time in Germany: https://world.openfoodfacts.org/product/2312251310191757006523

aleene commented 4 years ago

This is a "feature" of the barcodescanner that OFF uses. Or does is this not seen as a valid code? My app does recognizes this code.

bredowmax commented 4 years ago

True, the Edeka example works on my iOS OFF. The WholeFoods one, however, does not get recognised by OFF (Scandit says both codes are a Code 128 code)

bredowmax commented 4 years ago

The Edeka example has 22 digits, but the Whole Foods example has 27 digits

aleene commented 4 years ago

Maybe there is a number of digits check.

teolemon commented 4 years ago

https://developer.apple.com/documentation/vision/vnbarcodesymbology ?

bredowmax commented 4 years ago

Thanks @teolemon for the link. Yes, Code128 is on this list! As @aleene pointed out, Code128 is indeed supported - but apparently they can vary in length. A code with 27 digits was unsupported, so it could be a failed checking number test?

aleene commented 4 years ago

Just checked: Code128 is supported in the IOS app and the Pastrami code is correctly read.

It is also shown in the history.

So for me there is no issue.