• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: finding jpeg dimensions
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: finding jpeg dimensions
      • From: David Teran <email@hidden>
References: 
 >finding jpef dimensions (From: Wes James <email@hidden>)
 >Re: finding jpeg dimensions - should be jpeg not jpef (From: Wes James <email@hidden>)

  • Prev by Date: Re: No more evaluation license keys?
  • Next by Date: Re: finding jpeg dimensions - should be jpeg not jpef
  • Previous by thread: Re: finding jpeg dimensions - should be jpeg not jpef
  • Next by thread: Re: finding jpeg dimensions
  • Index(es):
    • Date
    • Thread