Win a copy of Java Concurrency Live Lessons this week in the Threads forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JPEG-FILE WIDTH  RSS feed

 
Sergiy Kamenyev
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everybody,
How can I determine JPEG-file width from JAVA-BEAN if this file is on my hard drive?
Thank you.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65833
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hmmm, not really a JSP question. Not being sure which API is best used to inspect image files, I'm going to move this to 'Other Java APIs' and we'll see if we get any hits there.
bear
 
Sergiy Kamenyev
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am replying to myself .
This works:
import java.awt.Image;
import javax.swing.ImageIcon;
...
Image image=new ImageIcon("u.jpg").getImage();
int qb;
qb=image.getWidth(null);
, but I am not sure that it will work everywhere.
Your opinion?
Thank you.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!