ExifTool Forum

ExifTool => Archives => Topic started by: Archive on May 12, 2010, 08:54:40 AM

Title: setting OriginalRawFileName
Post by: Archive on May 12, 2010, 08:54:40 AM
[Originally posted by davitof on 2009-10-07 11:26:24-07]

Hello

I am new to exiftool, so please excuse me if I am missing something obvious. I am trying to set OriginalFileName, and I don't understand why exiftool refuses to.

My first idea was to use
Code:
 exiftool "-OriginalRawFileName<=%f.%e" *.jpg
(ok, now everyone knows I am running Windows ;-) )

I get:
Code:
 Warning OriginalRawFileName too large to write in JPEG segment - W128_129.jpg
  O image files updated
  1 image files unchanged

If I try the "hardcoded" version:
Code:
 exiftool -OriginalRawFileName=W128_129.jpg *.jpg
it works perfectly.

I guess I don't understand how &lt= and %f work. What I am trying to do is store the current name of the file into the OriginalRawFileName (before renaming the picture, of course). Can this be achieved directly using standard exiftool options or will I have to use some batch trickery?
Title: Re: setting OriginalRawFileName
Post by: Archive on May 12, 2010, 08:54:40 AM
[Originally posted by exiftool on 2009-10-07 11:41:39-07]

You'll chuckle when I tell you what you tried to do with your
first command.  The "<=" syntax read the entire contents
of the specified file as the value for the tag.  So you were trying
to write the file into itself, which is cool, but probably not what
you wanted.  Instead, I think you wanted to do this:

Code:
exiftool "-rawfilename<filename" *.jpg

However, I should point out that this is a non-standard use
for the RawFileName tag.  This is a DNG tag which is used
to represent the original file name of the raw image.
The only disadvantage of doing something non-standard
like this is that other you probably won't be able to use
this information in other utilities (other than exiftool I mean).

- Phil
Title: Re: setting OriginalRawFileName
Post by: Archive on May 12, 2010, 08:54:40 AM
[Originally posted by exiftool on 2009-10-07 11:43:25-07]

Oops.  I wish this forum had an editing feature.  Replace
all "RawFileName" with "OriginalRawFileName" in my post
above. - Phil
Title: Re: setting OriginalRawFileName
Post by: Archive on May 12, 2010, 08:54:40 AM
[Originally posted by davitof on 2009-10-07 14:28:13-07]

You were right, very funny :-D

I agree what I am trying to do is non standard, but RawImageFileName is the closest tag to what I needed: a tag to keep the original file name before renaming the file. I want to keep track of it because I keep a backup of each original image and I want to be able to easily find it if I need to.
Title: Re: setting OriginalRawFileName
Post by: Archive on May 12, 2010, 08:54:40 AM
[Originally posted by davitof on 2009-10-07 14:31:50-07]

Hmm, I'm doing typos too. I meant OriginalRawFileName, of course.
Title: Re: setting OriginalRawFileName
Post by: Archive on May 12, 2010, 08:54:40 AM
[Originally posted by davitof on 2009-10-08 06:08:07-07]

Thanks Phil, it works perfectly. I searched the documentation for "<" but although "-TAG[+-]<SRCTAG" is in the Option Summary, it is not mentioned in the Options Details. From now on, I'll check both sections!
Title: Re: setting OriginalRawFileName
Post by: Archive on May 12, 2010, 08:54:40 AM
[Originally posted by exiftool on 2009-10-08 10:48:21-07]

Glad it worked.  Just to clear things up, in the options
summary it says:

Code:
           -TAG[+-]<SRCTAG                  Copy tag value (see -tagsFromFile)

And if you look under -tagsFromFile as mentioned
in the options details you will find it fully documented:

Code:
           A powerful redirection feature allows a destination tag to be
            specified for each extracted tag.  With this feature, information
            may be written to a tag with a different name or group.  This is
            done using "'-SRCTAG>DSTTAG'" on the command line after -tagsFrom-
            File ("'-DSTTAG<SRCTAG'" also works).  Note that this argument
            must be quoted to prevent shell redirection, and there is no "="
            sign as when assigning new values.  Both source and destination
            tags may be prefixed by a group name, and "All" or "*" may be used
            as a tag or group name.  If no destination group is specified, the
            information is written to the preferred group.  As a convenience,
            "-tagsFromFile @" is assumed for any redirected tags which are
            specified without a prior -tagsFromFile option.  Copied tags may
            also be added or deleted from a list with arguments of the form
            "'-SRCTAG+>DSTTAG'" or "'-SRCTAG->DSTTAG'".

            An extension of the redirection feature allows strings involving
            tag names to be used on the right hand side of the "<" symbol with
            the syntax "'-DSTTAG<STR'", where tag names in STR are prefixed
            with a "$" symbol.  See the -p option for more details about this
            syntax.  Strings starting with a "=" sign must insert a single
            space after the "<" to avoid confusion with the "<=" syntax which
            would otherwise attempt to set the tag value from the contents of
            a file.  A single space at the start of the string is removed if
            it exists, but all other whitespace is preserved.

- Phil