pywikibot-catfiles / file-metadata

A python package to analyze files and provide useful metadata
MIT License
15 stars 1 forks source link

Barcode Analysis: Resource not found #31

Closed AbdealiLoKo closed 8 years ago

AbdealiLoKo commented 8 years ago

From https://travis-ci.org/AbdealiJK/file-metadata/jobs/136607124

319 . Analyzing File:Tour revolver.jpg
Exception in thread "main" java.io.IOException: Resource not found: file:///home/travis/build/AbdealiJK/file-metadata/tests/files/File_Tour_revolver.jpg
    at com.google.zxing.client.j2se.ImageReader.readImage(ImageReader.java:47)
    at com.google.zxing.client.j2se.DecodeWorker.decode(DecodeWorker.java:119)
    at com.google.zxing.client.j2se.DecodeWorker.call(DecodeWorker.java:75)
    at com.google.zxing.client.j2se.CommandLineRunner.main(CommandLineRunner.java:84)
Caused by: java.lang.IllegalArgumentException: Numbers of source Raster bands and source color space components do not match
    at java.awt.image.ColorConvertOp.filter(ColorConvertOp.java:482)
    at com.sun.imageio.plugins.jpeg.JPEGImageReader.acceptPixels(JPEGImageReader.java:1263)
    at com.sun.imageio.plugins.jpeg.JPEGImageReader.readImage(Native Method)
    at com.sun.imageio.plugins.jpeg.JPEGImageReader.readInternal(JPEGImageReader.java:1231)
    at com.sun.imageio.plugins.jpeg.JPEGImageReader.read(JPEGImageReader.java:1034)
    at javax.imageio.ImageIO.read(ImageIO.java:1448)
    at javax.imageio.ImageIO.read(ImageIO.java:1400)
    at com.google.zxing.client.j2se.ImageReader.readImage(ImageReader.java:45)
    ... 3 more
AbdealiLoKo commented 8 years ago

Ok, so the actual error is Numbers of source Raster bands and source color space components do not match and it seems to make sense:

The exifdata for Tour revolver.jpg says:

Both of which are contradictory. The actual shape is (694, 801, 3).

I think it was because teh ICC Profile has references to an Apple computer and Epson corporation (printer?).

Not sure what needs to be done here. It seems like Java is getting confused because of invalid exifdata. Should I silence such errors ? Or let the error be shown ? Note that Pillow/skimage doesnt care about it though ^^

jayvdb commented 8 years ago

It should be reported to the wiki, indicating that one tool cant read it, and let humans decide if it should be fixed.

AbdealiLoKo commented 8 years ago

Done :+1: Wrote on the talk pages at