ExifTool Forum

ExifTool => The "exiftool" Application => Topic started by: windlematt on June 25, 2010, 03:59:36 AM

Title: Removing quotation marks
Post by: windlematt on June 25, 2010, 03:59:36 AM
Hi,

I'm trying to convert old Microsoft Digital Image Suite keywords to standard IPTC Keywords so that I can use them in products like Adobe Bridge.

The following command moves the keywords into the correct IPTC field I want:

exiftool "-keywords -description<xpkeywords" filename.jpg

But it leaves quotation marks around the keywords so they are not recognised as individual keywords in Bridge.

For example, in MDIS if I had 2 keywords say family, home then after conversion using the above command they appear in the IPTC field as "family, home" (with quotation marks) and are then only recognised as a single keyword in Bridge.

Is there an easy way to move them without having the quotation marks added in the process or even remove them afterwoulds?

I've got about 2,000 photo's to convert with lots of different keywords so would prefer not to go in and edit every single one.

And I'm running strawberry Perl on Windows XP if this helps.

Thanks in advance,
Matt.
Title: Re: Removing quotation marks
Post by: Phil Harvey on June 25, 2010, 07:21:24 AM
Hi Matt,

First, I think you made a typo in your command.  It should be:

exiftool "-keywords<xpkeywords" filename.jpg

The quotation marks you mention are probably being added by Bridge when it displays the keywords.

The problem is that the XPKeywords is a single string.  But you can create a user-defined tag to separate the XPKeywords string using this config file:


%Image::ExifTool::UserDefined = (
    'Image::ExifTool::Composite' => {
        MyKeywords => {
            Require => 'XPKeywords',
            ValueConv => 'my @v = split(", ",$val); \@v',
        },
    }
);
1;  #end


with this installed (https://exiftool.org/config.html), this command will do what you want:

exiftool "-keywords<mykeywords" filename.jpg

- Phil
Title: Re: Removing quotation marks
Post by: windlematt on June 27, 2010, 03:49:04 PM
Phil, genius, it works!

:)

Many thanks,
Matt.
Title: Re: Removing quotation marks
Post by: amitinddr on November 19, 2013, 01:30:56 AM
Hi Phil
Thank you for gifting us with such an amazing tool. I am struggling around with a strange problem. I followed this thread to convert the keywords to IPTC standards. Now the  problem is with multiple keywords. My custom software reads space separated values. So for example, the Windows keywords rose;lily are currently converted to rose,lily (when I see through Mac) but I want them to be converted either as rose, lily (observe the space before lily) or simply rose lily. Your suggestion on this would be great help to me.
Title: Re: Removing quotation marks
Post by: amitinddr on November 19, 2013, 06:17:22 AM
Just to elaborate attached S2 solves my purpose. It shows both keywords in different lines in ExifPilot but S1 does not. It shows keywords as , separated.
Title: Re: Removing quotation marks
Post by: Phil Harvey on November 19, 2013, 07:19:06 AM
The IPTC:Keywords are stored separately.  The separator is not stored in the file.  ExifTool adds the separator after it extracts the Keywords, and this separator may be changed with the -sep option.  See FAQ 17 (https://exiftool.org/faq.html#Q17) for more information about this.

- Phil
Title: Re: Removing quotation marks
Post by: amitinddr on November 20, 2013, 01:32:16 AM
Thanks Phil. I tried this and it worked well. Now I will import the images into the system and I am sure that it will work fine. Thanks for all your help.
Title: Re: Removing quotation marks
Post by: amitinddr on November 21, 2013, 11:16:47 AM
Phil
It worked extremely well so far. The only thing I am left with is the backup files. I usually do not need backup files and they are quite annoying. I tried searching around but could not find out how I can prevent it from saving backup files. (Sorry I am a newbie). Please suggest.
Title: Re: Removing quotation marks
Post by: Phil Harvey on November 21, 2013, 12:50:04 PM
Add the -overwrite_original option to avoid this.

- Phil
Title: Re: Removing quotation marks
Post by: elhiero on September 06, 2014, 06:29:42 PM
Very useful topic,  which describes how to use of a config file.
And useful link  https://exiftool.org/config.html
Thank you Phil !

I found this topic when I was looking for copying xpkeywords in newer metadatas  (iptc:keywords and xmp:subject)

In this script, you are using  "MyKeywords" as a user-defined tag , but unfortunately, this tag already exists (composite:mykeywords) and Microsoft photo gallery stores keywords also in this tag !  so, this exemple is a bit confuse ( for not english readers)
But the script works very well ...

Thanks
Title: Re: Removing quotation marks
Post by: Phil Harvey on September 06, 2014, 08:25:36 PM
I think you misunderstood.  The Composite:MyKeywords tag defined in the config file is derived from XPKeywords.  So if this config file is active, and XPKeywords is defined, then ExifTool will report a value for MyKeywords.  This isn't a separate value stored in the file, but only a reformatted version of the value for XPKeywords (that is compatible for writing to IPTC:Keywords or XMP:Subject).

So Microsoft photo gallery stores XPKeywords, not MyKeywords.

- Phil
Title: Re: Removing quotation marks
Post by: elhiero on September 07, 2014, 05:08:47 AM
Thanks for this very clear explanation
Yes, keywords are stored in XpKeywords but I can see in the tag list extracted by Exiftool that Microsoft  keywords are also stored in a metadata named  " Composite MyKeywords "   
( it's not a problem, just an information ... and I dont know what are "composite metadata" I only work with iptc, exif, xmp )

---- Composite ----
Aperture                        : 3.5
Image Size                      : 2592x1944
My Keywords                     : clown, train
Shutter Speed                   : 1/40
Thumbnail Image                 : (Binary data 15138 bytes, use -b option to extract)
Focal Length                    : 6.7 mm
Light Value                     : 8.3

... and for people speaking francais ( français  ;) ) , I'm writing a few pages about metadata here :
http://orchisere.pagesperso-orange.fr/logiciels/thumb.html


Title: Re: Removing quotation marks
Post by: Phil Harvey on September 07, 2014, 08:04:01 AM
Maybe reading the explanation on the Composite tags documentation page (https://exiftool.org/TagNames/Composite.html) would help clear things up.

- Phil
Title: Re: Removing quotation marks
Post by: StarGeek on September 07, 2014, 01:24:31 PM
Quote from: elhiero on September 07, 2014, 05:08:47 AM
Yes, keywords are stored in XpKeywords but I can see in the tag list extracted by Exiftool that Microsoft  keywords are also stored in a metadata named  " Composite MyKeywords "   

Try running the same command but with -config "" as the very first option.  For example, ExifTool -config "" -g1 File.  You should see that the MyKeywords tag will disappear.  That's would be because the MyKeywords tag is a user defined tag in your .ExifTool_config file.
Title: Re: Removing quotation marks
Post by: elhiero on September 09, 2014, 04:30:19 PM
You are right, StarGeek.  I tried in a new directoy, and now this "virtual" metadata doesn't appear.

An admin should strike my wrong comments up there

In the directory where I was working, I wrote a config file named  old.exiftool_config
It seems that  exiftool reads this file, even through FastPhotoTagger GUI  (very good G.U.I. ! )
Title: Re: Removing quotation marks
Post by: Phil Harvey on September 09, 2014, 08:20:12 PM
ExifTool will only automatically read a config file if it is named ".ExifTool_config".  So it wouldn't read "old.exiftool_config" unless the -config option was used.

- Phil