Win a copy of Java by Comparison (eBook) this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Image width & height return negative  RSS feed

 
Ranch Hand
Posts: 191
Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


I am getting -1 for both height and width, when in fact the JPG image is quite large
 
Rancher
Posts: 2866
16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 191
Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
I was born with webbed fish toes. This tiny ad is my only friend:
Thread Boost - a very different sort of advertising
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!