Get image file properties

  • Thread starter Thread starter Paul Loveless
  • Start date Start date
P

Paul Loveless

Hi all, I would like to create a routine that retrieves specific properties
from an image file (ex. a jpeg) without having to open
the file. For example, in WinXP when you right-click a jpg file and select
properties, then summary, you are presented with information about the image
(height, width, resolution, colour depth etc.). I know how to create a
FileInfo object and retrieve the file attributes, but the attributes
returned are the standard hidden, system, read-only and archive attributes.
Is there a way of retrieving this "extra" information. I don't want to open
the file to get this information because of the time and memory required to
do so, particularly if there are hundreds of image files to go through.

Does anyone have any ideas?

Regards,
Paul.
 
Hello,

Paul Loveless said:
Hi all, I would like to create a routine that retrieves specific
properties from an image file (ex. a jpeg) without having
to open the file. For example, in WinXP when you right-
click a jpg file and select properties, then summary, you
are presented with information about the image
(height, width, resolution, colour depth etc.). I know
how to create a FileInfo object and retrieve the file
attributes, but the attributes returned are the standard
hidden, system, read-only and archive attributes. Is
there a way of retrieving this "extra" information.

There is no general way for all file formats. I would suggest to open the
file and read only the parts required to determine the size of the image.
You can find information on the file formats at Wotsit[1].

[1] http://www.wotsit.org
 
Thanks for the reply. I was hoping for another way, but c'est la vie.

Regards,
Paul.

Herfried K. Wagner said:
Hello,

Paul Loveless said:
Hi all, I would like to create a routine that retrieves specific
properties from an image file (ex. a jpeg) without having
to open the file. For example, in WinXP when you right-
click a jpg file and select properties, then summary, you
are presented with information about the image
(height, width, resolution, colour depth etc.). I know
how to create a FileInfo object and retrieve the file
attributes, but the attributes returned are the standard
hidden, system, read-only and archive attributes. Is
there a way of retrieving this "extra" information.

There is no general way for all file formats. I would suggest to open the
file and read only the parts required to determine the size of the image.
You can find information on the file formats at Wotsit[1].

[1] http://www.wotsit.org
 
Back
Top