Checking image width then rename the filw as imagewidth_%f.%e

Started by Archive, May 12, 2010, 08:54:07 AM

Previous topic - Next topic

Archive

[Originally posted by oozy on 2007-07-23 19:14:18-07]

I want to check a bunch of image and rename them as imagewidth_%f.%e

I tried the following but not help

Code:
exiftool -if '$imagewidth<9999' -q -t -S -filename='$imagewidth'_%f.%e -r .

Archive

[Originally posted by exiftool on 2007-07-23 20:37:39-07]

Close, but '=' is used to assign the value of a tag.  You actually
want to copy the value from another tag (ImageWidth), so you
should use '<' instead.  ie)

Code:
exiftool -if '$imagewidth<9999' -q -filename'<$imagewidth'_%f.%e -r .

I have also taken out the -t and -S because these are only meaningful when
reading information.

Read the "COPYING EXAMPLES" section in the application documentation
for more examples of copying tags.

- Phil

Archive

[Originally posted by exiftool on 2007-07-23 20:41:01-07]

Ooops, sorry.  There was another problem: %f and %e only
work when a filename is expected, which it isn't when copying
tags.  Also, I needed braces around 'imagewidth' because it
was followed immediately by an underline (which is a valid
character in a tag name). So instead you need to do this:

Code:
exiftool -if '$imagewidth<9999' -q -filename'<${imagewidth}_$filename' -r .

- Phil

Archive

[Originally posted by exiftool on 2007-07-23 20:44:58-07]

Note to self: No more quick replies.

OK.  So %f and %e will work in this case, because a file name
is expected for the filename tag.  duh.  silly me.  Usually this
syntax doesn't expect a filename (as something like '<='
does), but when the tag is 'FileName' there is an exception.

Sorry about adding to the confusion.

- Phil