#1 2006-09-21 01:59

james
Member
Registered: 2006-09-21
Posts: 2

List of EXIF tags?

Hi,
I code in Delphi daily, but don't have a clue about
EXIF tags and which ones ReNamer supports, and
what syntax to use?

FileName := ':EXIF_Date:';
{works as expected, but what other EXIF tags are supported?}

I'd like to rename a jpg based on its exif date if it exists, otherwise
rename it based on its modified date. Here is what I've tried with
no success:

if (Length(':EXIF_Date:') = 0) then
  FileName := DateToStr(FileModifiedTime(FileName))
else
  FileName := ':EXIF_Date:';

The above conditional always returns the length of the string ':EXIF_Date:'
which is always 11, rather than the length of the actual exif date itself.
How can I test for the existence of an ':EXIF_Date:' tag?

Specific questions I have are:

1. Why are exif tags quoted like strings?
2. What is the purpose of the colons delimiting the exif tag name?
3. How can I test for the existence of an ':EXIF_Date:' tag?
4. Is there a help file that lists the supported exif tags?
5. What are meta tags I've seen mentioned in other posts?
6. Is there a list of meta tags supported?

Thanks for any help you can give.

James

Offline

#2 2006-09-21 05:59

den4b
Administrator
From: den4b.com
Registered: 2006-04-06
Posts: 3,370

Re: List of EXIF tags?

Hi James smile

To answer questions about meta tags, first, I need to explain you how they get processed within ReNamer. Each of the supported tag has a name assigned to it (for example EXIF_Date), surrounded with colons (reason for colons is yet to be explained). After each rule is applied, ReNamer checks for existence of meta tags, and replaces them with their values. So none of the rules can really use the value of the meta tags, but they can tell application where to insert one or another. It would be very inefficient to search for all of the 43 supported meta tags in each file after each rule has been applied, and that is where delimiter kicks in. Colons are not really used that often in the filename, in fact, it can only be used once, and in vary rare cases, when you specify a new name as a new path to the file (for example C:\folder\file.ext). It is much faster to search for a tag delimiter first, i.e. ":" (colons), then if found - search for another one after the first one and check if the text between them actually represents a valid meta tag. If it finds a valid textual meta tag - application calls special routines to extract the value of the tag from the file, then the value will replace the tag within the filename.

I think after that description you will have most of the questions answered, except this one... What meta tags does ReNamer support? 43 at the moment, the detailed list of them is at the bottom of this post. A list of them is also available in ReNamer from within Insert and Replace rule. Find a button with an icon of a lightning - click on it and you'll get a meta tag selection dialog.

:File_SizeBytes:          => Size of file in bytes
:File_SizeKB:             => Size of file in Kb
:File_SizeMB:             => Size of file in Mb
:File_DateCreated:        => File created date
:File_DateModified:       => File last modified date
:File_TimeCreated:        => File created time
:File_TimeModified:       => File last modified time
:File_FolderName:         => Name of the parent folder
:File_DOSName:            => Short name in the 8.3 format
:ID3_Artist:              => ID3 Artist
:ID3_Title:               => ID3 Title
:ID3_Album:               => ID3 Album
:ID3_Year:                => ID3 Year
:ID3_Genre:               => ID3 Genre
:ID3_TrackNo:             => ID3 Track Number
:HTML_Title:              => Title tag extracted from an HTML file
:EXIF_Date:               => EXIF Original Date
:EXIF_Time:               => EXIF Original Time
:EXIF_Model:              => EXIF Camera Model
:EXIF_Make:               => EXIF Camera Make
:Image_WidthAndHeight:    => Real Width and Height of an image in pixels
:Image_Width:             => Real Width of an image in pixels
:Image_Height:            => Real Height of an image in pixels
:Image_Pixels:            => Amount of pixels in the image
:Document_Title:          => Summary Information - Title
:Document_Subject:        => Summary Information - Subject
:Document_Author:         => Summary Information - Author
:Document_NumberOfPages:  => Summary Information - Number of Pages
:Hash_MD5:                => MD5 Hash of a file
:Hash_SHA1:               => SHA1 Hash of a file
:Hash_CRC32:              => CRC32 Checksum of a file
:Email_DateSent:          => Email date sent
:Email_TimeSent:          => Email time sent
:Email_Subject:           => Email subject
:Email_Sender:            => Email sender
:AVI_FramesPerSecond:     => AVI Frames per Second
:AVI_TotalFrames:         => AVI Total amount of Frames
:AVI_DurationMins:        => AVI Duration in Minutes
:AVI_DurationSecs:        => AVI Duration in Seconds
:AVI_Width:               => AVI Width in Pixels
:AVI_Height:              => AVI Height in Pixels
:FileSig_Extension:       => File Signature Extension
:FileSig_Description:     => File Signature Information

Offline

#3 2006-09-21 06:09

den4b
Administrator
From: den4b.com
Registered: 2006-04-06
Posts: 3,370

Re: List of EXIF tags?

About your code...

I think the best solution to your problem would be to insert "[:EXIF_Date:]" (in square brackets), and check within PascalScript if contents of the square brackets is empty. If it is empty - then insert last modified date in them, then simply remove brackets and you are done. By the way, you can change the date-time format for meta tags in the Settings, in Meta Tags tab. While for FileModifiedTime function you will need to use FormatDateTime function, with standard Delphi date-time formatting variables.

Hope all of this will help smile

Offline

#4 2006-09-21 19:36

james
Member
Registered: 2006-09-21
Posts: 2

Re: List of EXIF tags?

Thank you for such an informative reply. I couldn't figure out how to use Replace->What so I never bothered to click on the lightning icon next to Replace->With. How does the Replace->What work? Does it accept * and ? as wildcards? What does the *|* do? Does Replace->With accept pascal expressions such as ':EXIF_Date:' + IntToStr(whatever);
Thanks again for your time in coding and support.
James

Offline

#5 2006-09-22 17:28

den4b
Administrator
From: den4b.com
Registered: 2006-04-06
Posts: 3,370

Re: List of EXIF tags?

Yes, Replace rule has a little bit ambiguous fields and I should really rename them: "What" -> "Find", and "With" -> "Replace". So if you have a file called "This is my file.txt" and you want to replace "my" with "his", then you need to set "my" in the "What" field, and "his" in the "With" field. After clicking the preview button you'll get "This is his file.txt".

This multi-item delimiter "*|*" will allow you to replace many items within a single rule, it was inherited from the old version when rules where static and you couldn't add more then one rule of the same type. Now rules are added dynamically and there is no need for that feature, but I didn't remove it yet, because sometimes it is handy to group similar replacement operations in one rule.

None of the rules understand wildcards ("*" and "?"), apart from RegEx rule, which has it's own meaning for them, every other rule will interptet them as normal characters. Also, none of the rules will accept PascalScript and it will be interpreted as normal text in them, apart from the PascalScript rule it-self ofcourse wink

You can use the textual representations of meta tags (for example ":EXIF_Date:") in any rule, and they will also be interpreted as normal text. But between rules ReNamer will be searching for them, and will replace them with their values, if such can be obtained.

Is it any clearer now?

Offline

Board footer

Powered by FluxBB