aspose file tools*
The moose likes I/O and Streams and the fly likes problem with ImageIO.read Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "problem with ImageIO.read" Watch "problem with ImageIO.read" New topic
Author

problem with ImageIO.read

Alejandro Barrero
Ranch Hand

Joined: Aug 01, 2005
Posts: 316
The same code may work or fail in the same method:

The only difference that I can tell between the two calls is that it works with an array of size 493,563 and fails, returns null, with an array of size 563,472.

Your help will be greatly appreciated.

Alejandro Barrero


Your help will be greatly appreciated,
Alejandro Barrero
Alejandro Barrero
Ranch Hand

Joined: Aug 01, 2005
Posts: 316
Found the problem. The byte array in the second case didn't correspond to an image. It would have been easier to detect if instead of null I had gotten a garbage image.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: problem with ImageIO.read