|
forums.silverfrost.com Welcome to the Silverfrost forums
|
View previous topic :: View next topic |
Author |
Message |
JohnCampbell
Joined: 16 Feb 2006 Posts: 2554 Location: Sydney
|
Posted: Wed Jun 22, 2011 1:29 am Post subject: Getting file properties |
|
|
I worked to late last night trying to organise all the photos I have downloaded from cameras onto my notebook, but not had the time to tidy them up when I did it. I had multiple copies of the same picture, often with different date/time stamps of when they were loaded onto the computer, rather than when they were taken. Often they also have different names, depending on the quick method I took to strip them from the camera.
Is there a routine that I can call to get photo specific properties, such as "Date Picture Taken" and "Dimensions" ?
I'm thinking of using my disk scanning program, which uses "files@" and then obtain more info if it is a picture file (.jpg or .bmp).
I looked at FILEINFO@, but the documentation appears to exclude some arguments with the note : "Arguments that do not appear in the above description are redundant in this operating system environment."
I recall someone posted a program example that provided some info on graphics files, but I can't locate it.
Any help ?
John |
|
Back to top |
|
|
Wilfried Linder
Joined: 14 Nov 2007 Posts: 314 Location: Düsseldorf, Germany
|
Posted: Wed Jun 22, 2011 5:59 am Post subject: |
|
|
In many cases, images from digital cameras are stored as JPGs. Those files have additional information in the so-called EXIF header, containing exposure time, lens opening, focal length, date and more. You may look for "EXIF reader" to find suitable software. There is no function available in FTN95 or ClearWin+ for this.
If you modify the original images (reduce the resolution, increase the compression rate, store the image in a different file format etc.) then it depend on the software whether the output file will also have an EXIF header. For instance, this will never be true for BMP files but often for JPGs.
Regards - Wilfried |
|
Back to top |
|
|
JohnCampbell
Joined: 16 Feb 2006 Posts: 2554 Location: Sydney
|
Posted: Thu Jun 23, 2011 2:49 am Post subject: |
|
|
Wilfried,
Thanks for your advice. I googled EXIF readers and downloaded a picture viewer, which gave more info on the .jpg file attributes.
I have also looked at the file attrributes that can be displayed in Windows Explorer, which include "Date Picture Taken" and "Dimensions".
I looked at FILEINFO@ and found that SIZE, ATIME, MTIME and CTIME all appear to give sensible info ( Seconds since 1970 !!, another format from that provided by FILES@). I'm not sure about the others.
We need a routine Get_NTFS_File_Info@ or Get_JPEG_File_Info@ to give more of the info reported in Windows Explorer. It would be interesting to know where Explorer gets the picture info from. Is it in the directory header or the file itself ?
Paul, If a WINAPI routine exists to recover these attributes, could you provide me with a fortran wrapper to call the routine ? I presume FILEINFO@ has this approach.
John |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7926 Location: Salford, UK
|
Posted: Thu Jun 23, 2011 7:23 am Post subject: |
|
|
I don't know of such an API function. If, as Wilfried says, the information is in the file header, then you will need to read the file as binary and locate the information you need. As I recall, there are FTN95 routines for reading in binary. |
|
Back to top |
|
|
davidb
Joined: 17 Jul 2009 Posts: 560 Location: UK
|
Posted: Thu Jun 30, 2011 5:41 pm Post subject: |
|
|
You can link with this library.
http://libexif.sourceforge.net/
If you don't want to use it you can figure out the offsets to the data you want from the comments in the source code. |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|