ExifTool Forum

ExifTool => The "exiftool" Application => Topic started by: AshleyB on October 26, 2018, 01:11:53 PM

Title: Creating xmp files with subject tag
Post by: AshleyB on October 26, 2018, 01:11:53 PM
This seems to work...
~/Downloads/exiftool/Image-ExifTool-11.16/exiftool -xmp:subject -X 20140528204420\ -\ DSC04786.JPG

<?xml version='1.0' encoding='UTF-8'?>
<rdf:RDF xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#'>

<rdf:Description rdf:about='20140528204420 - DSC04786.JPG'
  xmlns:et='http://ns.exiftool.ca/1.0/' et:toolkit='Image::ExifTool 11.16'
  xmlns:XMP-dc='http://ns.exiftool.ca/XMP/XMP-dc/1.0/'>
<XMP-dc:Subject>Scotland</XMP-dc:Subject>
</rdf:Description>
</rdf:RDF>


but this doesn't look right...
~/Downloads/exiftool/Image-ExifTool-11.16/exiftool -o %f.xmp -xmp:subject -X 20140528204420\ -\ DSC04786.JPG

    1 image files created
cat 20140528204420\ -\ DSC04786.xmp
<?xpacket begin='' id='W5M0MpCehiHzreSzNTczkc9d'?>
<x:xmpmeta xmlns:x='adobe:ns:meta/' x:xmptk='Image::ExifTool 11.16'>
<rdf:RDF xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#'>

<rdf:Description rdf:about=''
  xmlns:dc='http://purl.org/dc/elements/1.1/'>
  <dc:subject>
   <rdf:Bag>
    <rdf:li>Scotland</rdf:li>
   </rdf:Bag>
  </dc:subject>
</rdf:Description>
</rdf:RDF>
</x:xmpmeta>
<?xpacket end='w'?>


... am I doing something wrong or is this a bug?

Thanks.
Title: Re: Creating xmp files with subject tag
Post by: Phil Harvey on October 26, 2018, 02:00:17 PM
If you are looking at outputting the same text as from the first command, then use -w, not -o-w is for sending the console output to another file.  -o is for rewriting the input file in a different format.

- Phil
Title: Re: Creating xmp files with subject tag
Post by: AshleyB on October 27, 2018, 02:35:08 AM
Thanks Phil.  The -w option gave me what I expected, but XnViewMP didn't import the subject with the xmp file in that format.  XnViewMP does correctly import the tag when the xmp file is created using -o so it was my expectation that was wrong.
Title: Re: Creating xmp files with subject tag
Post by: Phil Harvey on October 27, 2018, 08:06:54 AM
You should be using XMP if you want to import into XnViewMP.  The -X command doesn't output XMP, so you shouldn't be using this at all.  What you essentially want is a sidecar XMP file.  See here (https://exiftool.org/metafiles.html) for lots of hints about this.

- Phil
Title: Re: Creating xmp files with subject tag
Post by: AshleyB on October 31, 2018, 11:06:47 AM
Thanks again.  I've just discovered that part of the difficulty I've been having is due to the way XnView behaves when using symbolic links to jpgs.  My jpgs are read-only in a shared directory and I have another user directory with symbolic links to the jpgs.  XnView loads the jpgs via the symbolic links and creates xmp sidecar files in the directory containing the symbolic links - but it won't read/import xmp sidecar files from the directory containing the symbolic links.  If the .xmp sidecar files are put in the directory that contains the target jpgs then XnView will import the subject tags from them.  I could create hardlinks for the xmp sidecar files so they exist in both directories to keep them in sync (perhaps for just one user).  Although the behavior of XnView is not intuitive I can see some advantages for my setup now I understand it.