Meaningless Drivel is fun!*
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 Murach's Java Servlets and JSP this week in the Servlets 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: 2152
    
    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

 
wood burning stoves
 
subject: Image width & height return negative
 
Similar Threads
Urgent: Need to know the size of Image Uploaded
Casting problem. Image to BufferedImage
Problem in displaying an image
Adjusting the size of an image (jpg)?
Image Observer