kbl/codebar — Issue #7: Results across sample images
Author: sandal
Created: 2012-01-30 18:58:24+00:00
State: open

Below you'll see my results weren't great... only ean13_clear2.png and ean13_clear5.png work correctly. Your README references a ean13_clear2.png which does not exist, so you'll need to update that as well.

I understand this project is still working on a very limited subset of images, and that is OK. But you absolutely need to improve the robustness of it for it to meet any measure of quality standards. Everything that fails below should raise a proper, customized error with a meaningful message, and all debugging log stuff should be off by default.

```
>> barcode = Codebar::Barcode.new('spec/images/ean13_clear3.png')
=> #>
>> barcode.decode
I, [2012-01-30T13:53:36.422638 #16050] INFO -- : processing Convert
I, [2012-01-30T13:53:36.451493 #16050] INFO -- : processing Grayscale
I, [2012-01-30T13:53:36.470133 #16050] INFO -- : processing Sharp
I, [2012-01-30T13:53:36.491408 #16050] INFO -- : processing Binary
TypeError: can't convert nil into String
from /Users/seacreature/devel/rmu/s10/marcin/codebar/lib/codebar/standard/ean13/code.rb:99:in `+'
from /Users/seacreature/devel/rmu/s10/marcin/codebar/lib/codebar/standard/ean13/code.rb:99:in `block in decode'
from /Users/seacreature/devel/rmu/s10/marcin/codebar/lib/codebar/standard/ean13/code.rb:98:in `each'
from /Users/seacreature/devel/rmu/s10/marcin/codebar/lib/codebar/standard/ean13/code.rb:98:in `each_slice'
from /Users/seacreature/devel/rmu/s10/marcin/codebar/lib/codebar/standard/ean13/code.rb:98:in `decode'
from /Users/seacreature/devel/rmu/s10/marcin/codebar/lib/codebar/standard/ean13/code.rb:82:in `initialize'
from /Users/seacreature/devel/rmu/s10/marcin/codebar/lib/codebar/barcode.rb:8:in `new'
from /Users/seacreature/devel/rmu/s10/marcin/codebar/lib/codebar/barcode.rb:8:in `block in '
from /Users/seacreature/devel/rmu/s10/marcin/codebar/lib/codebar/barcode.rb:26:in `call'
from /Users/seacreature/devel/rmu/s10/marcin/codebar/lib/codebar/barcode.rb:26:in `decode'
from (irb):39
from /Users/seacreature/.rvm/rubies/ruby-1.9.3-p0/bin/irb:16:in `

'
>> barcode = Codebar::Barcode.new('spec/images/ean13_blurry.png')
=> #>
>> barcode.decode
I, [2012-01-30T13:53:49.817476 #16050] INFO -- : processing Convert
I, [2012-01-30T13:53:49.913946 #16050] INFO -- : processing Grayscale
I, [2012-01-30T13:53:49.997549 #16050] INFO -- : processing Sharp
I, [2012-01-30T13:53:50.097534 #16050] INFO -- : processing Binary
NoMethodError: undefined method `-' for nil:NilClass
from /Users/seacreature/devel/rmu/s10/marcin/codebar/lib/codebar/image/extractor.rb:44:in `convert_to_pixel_array'
from /Users/seacreature/devel/rmu/s10/marcin/codebar/lib/codebar/image/extractor.rb:21:in `extract'
from /Users/seacreature/devel/rmu/s10/marcin/codebar/lib/codebar/barcode.rb:25:in `decode'
from (irb):41
from /Users/seacreature/.rvm/rubies/ruby-1.9.3-p0/bin/irb:16:in `

'
>> barcode = Codebar::Barcode.new('spec/images/isbn13_blurry.png')
=> #>
>> barcode.decode
I, [2012-01-30T13:54:08.985268 #16050] INFO -- : processing Convert
I, [2012-01-30T13:54:09.114179 #16050] INFO -- : processing Grayscale
I, [2012-01-30T13:54:09.255295 #16050] INFO -- : processing Sharp
I, [2012-01-30T13:54:09.364343 #16050] INFO -- : processing Binary
NoMethodError: undefined method `-' for nil:NilClass
from /Users/seacreature/devel/rmu/s10/marcin/codebar/lib/codebar/image/extractor.rb:44:in `convert_to_pixel_array'
from /Users/seacreature/devel/rmu/s10/marcin/codebar/lib/codebar/image/extractor.rb:21:in `extract'
from /Users/seacreature/devel/rmu/s10/marcin/codebar/lib/codebar/barcode.rb:25:in `decode'
from (irb):43
from /Users/seacreature/.rvm/rubies/ruby-1.9.3-p0/bin/irb:16:in `

'
>> barcode = Codebar::Barcode.new('spec/images/ean13_color.png')
=> #>
>> barcode.decode
I, [2012-01-30T13:54:25.760893 #16050] INFO -- : processing Convert
I, [2012-01-30T13:54:25.800600 #16050] INFO -- : processing Grayscale
I, [2012-01-30T13:54:25.846336 #16050] INFO -- : processing Sharp
I, [2012-01-30T13:54:25.881693 #16050] INFO -- : processing Binary
TypeError: can't convert nil into String
from /Users/seacreature/devel/rmu/s10/marcin/codebar/lib/codebar/standard/ean13/code.rb:96:in `+'
from /Users/seacreature/devel/rmu/s10/marcin/codebar/lib/codebar/standard/ean13/code.rb:96:in `block in decode'
from /Users/seacreature/devel/rmu/s10/marcin/codebar/lib/codebar/standard/ean13/code.rb:95:in `each'
from /Users/seacreature/devel/rmu/s10/marcin/codebar/lib/codebar/standard/ean13/code.rb:95:in `each_slice'
from /Users/seacreature/devel/rmu/s10/marcin/codebar/lib/codebar/standard/ean13/code.rb:95:in `decode'
from /Users/seacreature/devel/rmu/s10/marcin/codebar/lib/codebar/standard/ean13/code.rb:82:in `initialize'
from /Users/seacreature/devel/rmu/s10/marcin/codebar/lib/codebar/barcode.rb:8:in `new'
from /Users/seacreature/devel/rmu/s10/marcin/codebar/lib/codebar/barcode.rb:8:in `block in '
from /Users/seacreature/devel/rmu/s10/marcin/codebar/lib/codebar/barcode.rb:26:in `call'
from /Users/seacreature/devel/rmu/s10/marcin/codebar/lib/codebar/barcode.rb:26:in `decode'
from (irb):45
from /Users/seacreature/.rvm/rubies/ruby-1.9.3-p0/bin/irb:16:in `

'
>> barcode = Codebar::Barcode.new('spec/images/ean13_clear2.jpg')
=> #>
>> barcode.decode
I, [2012-01-30T13:54:37.312373 #16050] INFO -- : processing Convert
Errno::ENOENT: No such file or directory - spec/images/ean13_clear2.jpg
from /Users/seacreature/.rvm/gems/ruby-1.9.3-p0/gems/mini_magick-3.4/lib/mini_magick.rb:133:in `initialize'
from /Users/seacreature/.rvm/gems/ruby-1.9.3-p0/gems/mini_magick-3.4/lib/mini_magick.rb:133:in `open'
from /Users/seacreature/.rvm/gems/ruby-1.9.3-p0/gems/mini_magick-3.4/lib/mini_magick.rb:133:in `open'
from /Users/seacreature/devel/rmu/s10/marcin/codebar/lib/codebar/image/processor.rb:21:in `convert'
from /Users/seacreature/devel/rmu/s10/marcin/codebar/lib/codebar/image/processor.rb:9:in `block in process'
from /Users/seacreature/devel/rmu/s10/marcin/codebar/lib/codebar/image/processor.rb:8:in `each'
from /Users/seacreature/devel/rmu/s10/marcin/codebar/lib/codebar/image/processor.rb:8:in `reduce'
from /Users/seacreature/devel/rmu/s10/marcin/codebar/lib/codebar/image/processor.rb:8:in `process'
from /Users/seacreature/devel/rmu/s10/marcin/codebar/lib/codebar/barcode.rb:36:in `processed_image'
from /Users/seacreature/devel/rmu/s10/marcin/codebar/lib/codebar/barcode.rb:25:in `decode'
from (irb):47
from /Users/seacreature/.rvm/rubies/ruby-1.9.3-p0/bin/irb:16:in `

'
>> barcode = Codebar::Barcode.new('spec/images/ean13_clear2.png')
=> #>
>> barcode.decode
I, [2012-01-30T13:54:55.955494 #16050] INFO -- : processing Convert
I, [2012-01-30T13:54:55.988061 #16050] INFO -- : processing Grayscale
I, [2012-01-30T13:54:56.005826 #16050] INFO -- : processing Sharp
I, [2012-01-30T13:54:56.025729 #16050] INFO -- : processing Binary
=> "0075678164125"
>> barcode = Codebar::Barcode.new('spec/images/ean13_clear5.png')
=> #>
>> barcode.decode
I, [2012-01-30T13:55:00.500183 #16050] INFO -- : processing Convert
I, [2012-01-30T13:55:00.536218 #16050] INFO -- : processing Grayscale
I, [2012-01-30T13:55:00.558243 #16050] INFO -- : processing Sharp
I, [2012-01-30T13:55:00.585860 #16050] INFO -- : processing Binary
=> "1234567890128"
```