Width of an image

A

Armin Gajda

Hi,

what is the easiest way to get the width of an image (png or jpg).
I don't want to show the image or do anything else with it (I not even
have a gui). It's just the width I need.
 
M

M.J. Dance

Armin said:
Hi,

what is the easiest way to get the width of an image (png or jpg).
I don't want to show the image or do anything else with it (I not even
have a gui). It's just the width I need.

ImageIO.read(...).getWidth();
 
C

Chris Uppal

Armin said:
what is the easiest way to get the width of an image (png or jpg).
I don't want to show the image or do anything else with it (I not even
have a gui). It's just the width I need.

If the idea is to avoid the expense of parsing/loading the image data itself,
then you might want to look at Marco Schmidt's ImageInfo at:

http://schmidt.devlib.org/index.html

-- chris
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top