Main Menu

IPTC Folder Rename

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

Previous topic - Next topic

Archive

[Originally posted by bobbyandck on 2007-01-21 23:46:19-08]

Hello,

I have tried out ExifTool and find it extremely useful, there is just one thing I just cannot get to work, could someone help me out ?

I have a file: 1.jpg, it contains a IPTC Category: CAT and I would like to move it to CAT\1.jpg

Perhaps I am totally on the wrong path but I've tried unsuccessfully many different variants of the following:
Code:
exiftool "-directory<iptc:category" 1.jpg
(this results in the file being moved to a folder named "-k")

Thank you,

Andrew

Archive

[Originally posted by exiftool on 2007-01-22 01:26:06-08]

Hi Andrew,

This works when I try it:

Code:
> ./exiftool a.jpg -iptc:category=CAT
    1 image files updated
> ./exiftool a.jpg "-directory<iptc:category" -v3
======== a.jpg
Setting new values from a.jpg
Writing File:Directory
'a.jpg' --> 'CAT/a.jpg'
Created directory CAT
    + FileName = 'CAT/a.jpg'
    1 directories created
    1 image files updated

And I don't see where your "-k" would come from.  I think
the problem may be somehow related to your shell.  What
operating system are you using?  And what version of
exiftool?  And is it the stand-alone or perl package?

We should be able to figure this out.

- Phil

Archive

[Originally posted by bobbyandck on 2007-01-22 09:19:37-08]

Thank you for your fast response, the only problem is that your answer also creates a folder named "-k"

I am using the stand alone windows executable version 6.69

Thank you

Archive

[Originally posted by exiftool on 2007-01-22 12:32:31-08]

Is the executable still named "exiftool(-k).exe"?  If so, rename it to
"exiftool.exe" instead.   If it is named "exiftool(-k).exe", I can perhaps
see where the "-k" directory came from, although I can't understand
why.  I will run a few tests tonight when I can get my hands on a PC.

- Phil

Archive

[Originally posted by bobbyandck on 2007-01-22 20:57:04-08]

Hi,

I am sorry, but that doesn't work, after removing the (-k) it still creates the -k folder

is there perhaps something to do with having the -k parameter interfering (I believe comes automatically with the windows precompiled version) with the directory renaming ?

Thank you, Andrew

Archive

[Originally posted by exiftool on 2007-01-22 21:50:27-08]

I'm on a Windows XP machine now as I type, and
I just tried this in a cmd.exe shell and it worked
fine for me.  There must be something wrong with
the command line you are using.  Below I cut and
paste my entire session.  Here, "exiftool(-k).exe"
and "a.jpg" are on my desktop.  Try these exact
steps:

--------

Microsoft Windows XP [Version 5.1.2600]

(C) Copyright 1985-2001 Microsoft Corp.

C:\WINDOWS\SYSTEM32>cd "\Documents and Settings\Phil\Desktop"

C:\Documents and Settings\Phil\Desktop>"exiftool(-k).exe" -ver

6.69

C:\Documents and Settings\Phil\Desktop>"exiftool(-k).exe" -iptc:category=CAT a.jpg

    1 image files updated

C:\Documents and Settings\Phil\Desktop>"exiftool(-k).exe" "-directory<iptc:category" -v3 a.jpg

======== a.jpg

Setting new values from a.jpg

Writing File:Directory

'a.jpg' --> 'CAT/a.jpg'

Created directory CAT

    + FileName = 'CAT/a.jpg'

    1 directories created

    1 image files updated

C:\Documents and Settings\Phil\Desktop>dir CAT

 Volume in drive C has no label.

 Volume Serial Number is C8F0-D326

 Directory of C:\Documents and Settings\Phil\Desktop\CAT

22/01/2007  04:28 PM    <DIR>          .

22/01/2007  04:28 PM    <DIR>          ..

22/01/2007  04:28 PM             5,545 a.jpg

               1 File(s)          5,545 bytes

               2 Dir(s)  11,901,591,552 bytes free

C:\Documents and Settings\Phil\Desktop>

--------

(Man!  That was painful to post in here.  It didn't work
when enclosed in
Code:
...
because apparently
the IE newlines aren't compatible with this forum.  Yuk.  So I had
to do all the linefeeds by hand with
 and escape all
< and > symbols manually.  Nasty.)

- Phil

Archive

[Originally posted by bobbyandck on 2007-01-22 22:47:44-08]

Thanks a lot for putting all of this up, I agree that this forum isn't the most practical for writing anything more special that one block of text. The software does work now, the problem was perhaps that I had corrected the maker offset by using the tagsfromfile option as the file was giving errors, now it works with all the other files where I didn't correct the offset.

I just have one more question, if I now decide to categorise it first by category (as we have done) then a subfolder by year (ie CAT/2006) how woulsd I do it ? I have tried the following

Code:
exiftool(-k).exe -d %Y "-directory<iptc:category/datetimeoriginal" -v3 a.jpg
but that only classifies it by year.

I am terribly sorry to bother you with all of these problems, it is just that I've been looking for a long time for a software which would classify all of my images on the hard disk (contrary to some database), and this seems like the perfect tool but I don't yet seem to get it working fully
 thank you again, Andrew

Archive

[Originally posted by exiftool on 2007-01-23 01:02:47-08]

Hi Andrew,

Well, I'm glad it works for a good file, but it would be nice to understand
the behaviour for the bad one.

You're getting deeper into the special features of exiftool now, which
could potentially be confusing for a new user, but here goes:

The redirection feature takes either a single tag name on the RHS, or
an expression.  In the expression, tag names must be prefixed by
a '$' symbol.  So what you want is this:

Code:
exiftool(-k).exe -d %Y "-directory<$iptc:category/$datetimeoriginal" -v3 a.jpg

This may all seem a bit confusing until you get used to it.

- Phil

Archive

[Originally posted by bobbyandck on 2007-01-25 17:09:19-08]

Thank you very much for your clear explanation, I now manage to do everything I wanted to do.

For the problem with the "-k" folder, it appears as if it was mainly a beginner mistake, instead of putting:
Code:
exiftool(-k).exe a.jpg "-directory<iptc:category" -v3
I had inverted the
Code:
"<"
sign as I didn't initially understand the meaning of it, which wrote the content of "directory" to the IPTC category.

But then another question arises, why is the directory "-k" ?

here is a excerpt of the output:
Code:
exiftool(-k).exe b.jpg
ExifTool Version Number         : 6.69
File Name                       : b.jpg
Directory                       : -k
File Size                       : 1149 kB
File Modification Date/Time     : 2006:05:21 13:26:20
File Type                       : JPEG
...

Thank you and sorry for the late response.

Andrew

Archive

[Originally posted by exiftool on 2007-01-25 17:48:29-08]

Hi Andrew

Good point.  The stand-alone version is not reporting the directory properly.

Thanks, I will look into this.

- Phil

Archive

[Originally posted by exiftool on 2007-01-25 18:17:41-08]

I have just added a patch to the standalone ExifTool 6.72 which
has just been released to hopefully solve the directory name problem.

Thanks for pointing this out.  Sorry for any confusion it caused.

- Phil

Archive

[Originally posted by bobbyandck on 2007-01-26 08:48:44-08]

Excellent ! Great job, and congratulations for the fast response. Have a nice day, Andrew