Possible to convert from ACDSee 'Categories' tag to Adobe 'Hierarchical Subject'

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

Previous topic - Next topic

Archive

[Originally posted by alphamoose on 2009-05-04 00:09:15-07]

I'm trying to convert a whole mess of images tagged with ACDSee's categories to use by Lightroom or Bridge. It looks like the equivalent tag is 'Hierarchical Subject', but of course the syntax is different. Any pointers on where I'd begin investigating how to do this? I'm thinking along the lines of a mess of perl to parse the Categories tag and get it into the format I want, but I'm not sure whether I'm on the right track.

Archive

[Originally posted by exiftool on 2009-05-04 12:01:07-07]

This type of thing is best done with a user-defined tag.  Then
you only need to write a bit of Perl to convert the value to the proper form.

- Phil

Archive

[Originally posted by alphamoose on 2009-05-05 03:34:23-07]

Would this be a composite tag, then?

Archive

[Originally posted by exiftool on 2009-05-05 11:34:51-07]

Yes.

Archive

[Originally posted by alphamoose on 2009-05-06 04:23:02-07]

It turns out that the Adobe software expects multiple instances of the 'Subject' and 'HierarchicalSubject' keywords, one for each keyword. Is a user defined key still the way to do this? I wrote some perl that will take the 'Categories' tag in my files and generate user-defined Subject and HierarchicalSubject tags, but I don't know how to cause that to generate multiple instances of each tag. That is to say, Categories could contain three keywords, but a user-defined key that took it as its source would just generate one key/value pair. Or am I mistaken?
Thanks.

Archive

[Originally posted by exiftool on 2009-05-06 11:38:42-07]

Ah yes.  This is more than just a simple user-defined tag then,
but still certainly possible.  Lists of values are passed as array
references in the ValueConv of a user-defined tag.  An input
value ($val) may be an array reference if the corresponding
Require'd tag is a List-type tag.  And just return an array reference
from the ValueConv to return a list of values.  Then, when this
tag is copied to another List-type tag, it will result in multiple
instances as you require.   I can give you a specific example
of the definition required if you give me more specifics about
what you want to do.

- Phil

Archive

[Originally posted by alphamoose on 2009-05-06 20:27:08-07]

Well, the 'Categories' tag that I'm starting with is a simple tag (not a list), but from that I need to create as many Subject tags as there are values in my source tag. So that I might end up generating Subject: PersonA, Subject: PersonB, and so forth. So the input value isn't a list, but the output would be.

Archive

[Originally posted by alphamoose on 2009-05-07 05:21:47-07]

Does 'return an array reference' just mean that the last statement in my ValueConv is an array, or something else?

Archive

[Originally posted by exiftool on 2009-05-07 10:55:41-07]

That's it.  Or you can actually use a 'return' statement if you want.

Code:
   ValueConv => q{
        my @a;
        # fill in array here
        # ...
        return \@a;
    },

- Phil

Archive

[Originally posted by exiftool on 2009-05-07 11:02:47-07]

Code:
Well, the 'Categories' tag that I'm starting with is a simple tag
(not a list), but from that I need to create as many Subject tags as there
are values in my source tag. So that I might end up generating Subject:
PersonA, Subject: PersonB, and so forth. So the input value isn't a list,
but the output would be.

I'm not sure what tag you're talking about.  The only "Categories" tag
exiftool recognizes is a Canon-specific tag.  However, this is how
it could work:

Code:
   MyTag => {
        Require => 'Categories',
        ValueConv => q{
            my @a = split /,\s*/, $val;
            return \@a;
        },
    },

and the command would be:

Code:
exiftool "-subject<mytag" FILE

- Phil