Unusual "Resource not found" on some files

19 views
Skip to first unread message

Abdeali Kothari

unread,
Jun 10, 2016, 10:24:30 AM6/10/16
to zxing
I seem to be getting an error which says "java.io.IOException: Resource not found: <file_url>" even when the file definitely exists. I'm also sure that the file url is correct.

I was using it to bulk test some JPG files on wikimedia to test for corner cases - You can find the travis log at https://travis-ci.org/AbdealiJK/file-metadata/jobs/136607124

It happens for:
- https://commons.wikimedia.org/wiki/File:Tour_revolver.jpg
- https://commons.wikimedia.org/wiki/File:Plateau_universel.jpg

I am using the javase version. My command is:

java -cp /home/ajk/.local/share/file-metadata/zxing/core-3.2.1.jar:/home/ajk/.local/share/file-metadata/zxing/javase-3.2.1.jar:/home/ajk/.local/share/file-metadata/zxing/jcommander-1.48.jar com.google.zxing.client.j2se.CommandLineRunner --multi file:///home/ajk/Downloads/Tour_revolver.jpg

The whole error message is:

Exception in thread "main" java.io.IOException: Resource not found: file:///home/ajk/Downloads/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:1268)
at com.sun.imageio.plugins.jpeg.JPEGImageReader.readImage(Native Method)
at com.sun.imageio.plugins.jpeg.JPEGImageReader.readInternal(JPEGImageReader.java:1236)
at com.sun.imageio.plugins.jpeg.JPEGImageReader.read(JPEGImageReader.java:1039)
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

Abdeali Kothari

unread,
Jun 11, 2016, 4:19:59 AM6/11/16
to zxing
That was really dumb of me. I didn't read the "Numbers of source Raster bands and source color space components do not match" in the 6th line of the error for some reason. Never mind ...
Reply all
Reply to author
Forward
0 new messages