Re: [gthumb-list] Need a Script to migrate .comments .xml files to ITPC



On Mon, Nov 21, 2011 at 11:33 AM, Paolo Bacchilega
<paolo bacchilega libero it> wrote:
Does anyone know of a way to convert the tags?
I have been looking for a script that would find the .comments .xml
files and then run some program to apply the tags to the actual .jpg
files.

gThumb 2.14 is supposed to read the old comment format (version 2) without
problem, it just can't read the very first version of the format (version
1), can you see if what version your comment are written in ? If in doubt
you can post the file here, removing the sensible info.  If you still have
the comments in version 1 format I can do a little script to convert them to
version 3.

Thank you to both of you who quickly responded. My investigation has
been a bit more difficult than I expected, because I have so many
pictures, and the .xml formats vary. I haven't found anything with a
comment version="1.0".

It seems that tags are visible in gThumb (with this many files gThumb
goes slowly), I just was expecting the tag dialog to start with
checked tags that were present already checked. My goal is that all of
the the images will have their tags in the ITPC, so I can
move/reorganize/edit-externally/rename without suffering tag loss.

Here are some example files...

$ zcat dscn5453.jpg.xml
<?xml version="1.0"?>
<Comment format="2.0"><Place/><Time>0</Time><Note/><Keywords>Noah,Birthday,Party</Keywords></Comment>

$ exiv2 -pi dscn5453.jpg
Iptc.Application2.Keywords                   String     4  Noah
Iptc.Application2.Keywords                   String      8  Birthday
Iptc.Application2.Keywords                   String     5  Party


$ cat 2004-11-27--01.02.08.jpg.xml
 <?xml version="1.0" encoding="UTF-8"?>
<comment version="3.0">
  <caption/>
  <note>Mercury  DIGITAL CAMERA        </note>
  <place/>
  <categories>
    <category value="Aquarium"/>
    <category value="Monterey"/>
    <category value="Noah"/>
    <category value="RedEye"/>
    <category value="Printed"/>
  </categories>
</comment>

$ exiv2 -pi ../2004-11-27--01.02.08.jpg

(Blank because there is no ITPC for 2004-11-27--01.02.08.jpg)


$ zcat DSCF9795.JPG.xml
<?xml version="1.0"?>
<Comment 
format="2.0"><Place/><Time>0</Time><Note/><Keywords>Person:Grace,Person:GradpaJoe</Keywords></Comment>

$ exiv2 -pi ../DSCF9795.JPG

(Blank because there is no ITPC for 2004-11-27--01.02.08.jpg)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]