forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Getting file properties

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> General
View previous topic :: View next topic  
Author Message
JohnCampbell



Joined: 16 Feb 2006
Posts: 2554
Location: Sydney

PostPosted: Wed Jun 22, 2011 1:29 am    Post subject: Getting file properties Reply with quote

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
View user's profile Send private message
Wilfried Linder



Joined: 14 Nov 2007
Posts: 314
Location: Düsseldorf, Germany

PostPosted: Wed Jun 22, 2011 5:59 am    Post subject: Reply with quote

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
View user's profile Send private message
JohnCampbell



Joined: 16 Feb 2006
Posts: 2554
Location: Sydney

PostPosted: Thu Jun 23, 2011 2:49 am    Post subject: Reply with quote

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
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7926
Location: Salford, UK

PostPosted: Thu Jun 23, 2011 7:23 am    Post subject: Reply with quote

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
View user's profile Send private message AIM Address
davidb



Joined: 17 Jul 2009
Posts: 560
Location: UK

PostPosted: Thu Jun 30, 2011 5:41 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> General All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
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