Re: finding jpeg dimensions
Re: finding jpeg dimensions
- Subject: Re: finding jpeg dimensions
- From: Dirk Bajohr <email@hidden>
- Date: Thu, 14 Oct 2004 01:43:30 +0200
I can't find any previous post from you, but you can get the dimensions
by creating a BufferedImage instance from your JPEG file. See the
Javadocs for ImageIO (Package javax.imageio).
You need to do something like this (incomplete and unchecked):
File imageFile; //assume this exists
BufferedImage img = javax.imageio.ImageIO.read(imageFile);
int height = img.getHeight();
int width = img.getWidth();
Keep in mind that the javax packages are (optional) extensions. There
are JDKs where the packages are not available.
Cheers,
Dirk
--
Dirk Bajohr
iSOLUTION - Individuelle Software fuer moderne Kommunikation
Hauptstr. 50
53757 Sankt Augustin
T +49 2241 921567-0
F +49 2241 921567-89
http://www.isolution.de
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden