wood burning stoves 2.0*
The moose likes I/O and Streams and the fly likes Image width & height return negative Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "Image width & height return negative" Watch "Image width & height return negative" New topic
Author

Image width & height return negative

Isaac Hewitt
Ranch Hand

Joined: Jul 24, 2006
Posts: 190



I am getting -1 for both height and width, when in fact the JPG image is quite large
Rob Camick
Ranch Hand

Joined: Jun 13, 2009
Posts: 2091
    
    7
I would guess the image hasn't been completely read into memory yet or you specified a bad file name.

You can try using ImageIO, or use a MediaTracker.
Isaac Hewitt
Ranch Hand

Joined: Jul 24, 2006
Posts: 190

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Image width & height return negative
 
Similar Threads
Urgent: Need to know the size of Image Uploaded
Image Observer
Problem in displaying an image
Adjusting the size of an image (jpg)?
Casting problem. Image to BufferedImage