Main Menu

acdsee:categories/Digikam

Started by ArchZu, September 12, 2024, 12:20:05 AM

Previous topic - Next topic

ArchZu

I'm trying to append xml tags generated by me to acdsee, although it works to use exiftool for this and digikam recognizes the tags, it seems that they are stored differently. How do I write exactly in "acdsee:categories="?

Digikam (8.4.0):
<?xpacket begin="�" id="W5M0MpCehiHzreSzNTczkc9d"?>
<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="XMP Core 4.4.0-Exiv2">
 <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
  <rdf:Description rdf:about=""
    xmlns:exif="http://ns.adobe.com/exif/1.0/"
    xmlns:photoshop="http://ns.adobe.com/photoshop/1.0/"
    xmlns:tiff="http://ns.adobe.com/tiff/1.0/"
    xmlns:xap="http://ns.adobe.com/xap/1.0/"
    xmlns:digiKam="http://www.digikam.org/ns/1.0/"
    xmlns:acdsee="http://ns.acdsee.com/iptc/1.0/"
   exif:DateTimeOriginal="2024-09-12T00:30:27"
   photoshop:DateCreated="2024-09-12T00:30:27"
   photoshop:Urgency="0"
   tiff:DateTime="2024-09-12T00:30:27"
   xap:CreateDate="2024-09-12T00:30:27"
   xap:MetadataDate="2024-09-12T00:30:27"
   xap:ModifyDate="2024-09-12T00:30:27"
   digiKam:ColorLabel="0"
   acdsee:categories="&lt;Categories&gt;&lt;Category Assigned=&quot;1&quot;&gt;Anime&lt;Category Assigned=&quot;1&quot;&gt;RPG1&lt;/Category&gt;&lt;Category Assigned=&quot;1&quot;&gt;Tensei1&lt;/Category&gt;&lt;Category Assigned=&quot;1&quot;&gt;Isekai1&lt;/Category&gt;&lt;/Category&gt;&lt;Category Assigned=&quot;1&quot;&gt;Manhwa&lt;Category Assigned=&quot;1&quot;&gt;RPG2&lt;/Category&gt;&lt;Category Assigned=&quot;1&quot;&gt;Tensei2&lt;/Category&gt;&lt;Category Assigned=&quot;1&quot;&gt;Isekai2&lt;/Category&gt;&lt;/Category&gt;&lt;Category Assigned=&quot;1&quot;&gt;1 1&lt;Category Assigned=&quot;1&quot;&gt;2 2&lt;Category Assigned=&quot;1&quot;&gt;3 3&lt;/Category&gt;&lt;/Category&gt;&lt;/Category&gt;&lt;Category Assigned=&quot;1&quot;&gt;Manga&lt;Category Assigned=&quot;1&quot;&gt;Isekai3&lt;/Category&gt;&lt;Category Assigned=&quot;1&quot;&gt;RPG3&lt;/Category&gt;&lt;Category Assigned=&quot;1&quot;&gt;Tensei3&lt;/Category&gt;&lt;/Category&gt;&lt;/Categories&gt;"/>
 </rdf:RDF>
</x:xmpmeta>
                                                                                                   
                                                                                                   
                                                                                                   
                                                                                                   
                                                                                                   
                                                                                                   
                                                                                                   
                                                                                                   
                                                                                                   
                                                                                                   
                                                                                                   
                                                                                                   
                                                                                                   
                                                                                                   
                                                                                                   
                                                                                                   
                                                                                                   
                                                                                                   
                                                                                                   
                                                                                                   
                          
<?xpacket end="w"?>%  

Exiftool (12.96): exiftool -overwrite_original "-Categories<=anime_acdsee.xml" anime_image.png                                                                         
<?xpacket begin='�' id='W5M0MpCehiHzreSzNTczkc9d'?>
<x:xmpmeta xmlns:x='adobe:ns:meta/' x:xmptk='Image::ExifTool 12.96'>
<rdf:RDF xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#'>

 <rdf:Description rdf:about=''
  xmlns:acdsee='http://ns.acdsee.com/iptc/1.0/'>
  <acdsee:categories>&lt;Categories&gt;&lt;Category Assigned=&quot;1&quot;&gt;Anime&lt;Category Assigned=&quot;1&quot;&gt;RPG1&lt;/Category&gt;&lt;Category Assigned=&quot;1&quot;&gt;Isekai1&lt;/Category&gt;&lt;Category Assigned=&quot;1&quot;&gt;Tensei1&lt;/Category&gt;&lt;/Category&gt;&lt;Category Assigned=&quot;1&quot;&gt;Manhwa&lt;Category Assigned=&quot;1&quot;&gt;RPG2&lt;/Category&gt;&lt;Category Assigned=&quot;1&quot;&gt;Isekai2&lt;/Category&gt;&lt;Category Assigned=&quot;1&quot;&gt;Tensei2&lt;/Category&gt;&lt;/Category&gt;&lt;Category Assigned=&quot;1&quot;&gt;1 1&lt;Category Assigned=&quot;1&quot;&gt;2 2&lt;Category Assigned=&quot;1&quot;&gt;3 3&lt;/Category&gt;&lt;/Category&gt;&lt;/Category&gt;&lt;Category Assigned=&quot;1&quot;&gt;Manga&lt;Category Assigned=&quot;1&quot;&gt;RPG3&lt;/Category&gt;&lt;Category Assigned=&quot;1&quot;&gt;Isekai3&lt;/Category&gt;&lt;Category Assigned=&quot;1&quot;&gt;Tensei3&lt;/Category&gt;&lt;/Category&gt;&lt;/Categories&gt;</acdsee:categories>
 </rdf:Description>
</rdf:RDF>
</x:xmpmeta>
<?xpacket end='r'?>% 

XML Test:
<Categories><Category Assigned="1">Anime<Category Assigned="1">RPG1</Category><Category Assigned="1">Isekai1</Category><Category Assigned="1">Tensei1</Category></Category><Category Assigned="1">Manhwa<Category Assigned="1">RPG2</Category><Category Assigned="1">Isekai2</Category><Category Assigned="1">Tensei2</Category></Category><Category Assigned="1">1 1<Category Assigned="1">2 2<Category Assigned="1">3 3</Category></Category></Category><Category Assigned="1">Manga<Category Assigned="1">RPG3</Category><Category Assigned="1">Isekai3</Category><Category Assigned="1">Tensei3</Category></Category></Categories>
Arch Linux (KDE Plasma)

StarGeek

I'm not sure what you are trying to do. Which of these has the correct data and the incorrect data. What exactly are you trying to set Categories to?

Exiftool doesn't edit XML and cannot edit the XML in the Categories tag. If you need to make changes to the data, you have to do it outside exiftool and then re-embed it as you would normally assign a string.

So if you needed to change
<Categories><Category Assigned="1">Anime<Category Assigned="1">RPG1</Category>into
<Categories><Category Assigned="0">Anime<Category Assigned="1">RPG1</Category>you would do it with some other program that can deal with XML and then rewrite the tag with
exiftool -Categories="<Categories><Category Assigned="0">Anime<Category Assigned="1">RPG1</Category>" file.jpg
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

ArchZu

Quote from: StarGeek on September 12, 2024, 01:35:06 AMI'm not sure what you are trying to do. Which of these has the correct data and the incorrect data. What exactly are you trying to set Categories to?

Digikam writes one way, it seems to use exiv2 to write 'x:xmptk="XMP Core 4.4.0-Exiv2"'. exiftool is recording the data differently.

exiv2:
<rdf:Description rdf:about=""
  acdsee:categories=""
/>

exiftool:
<rdf:Description rdf:about=''
  xmlns:acdsee='http://ns.acdsee.com/iptc/1.0/'>
  <acdsee:categories></acdsee:categories>
</rdf:Description>

I made these scripts for testing. but I will modify them later, they are still not good.
./stringtoxml.pl --tags "Anime/RPG" --tags "Anime/Isekai" --tags "Anime/Tensei" --tags "Manhwa/Isekai" --tags "Manhwa/Tensei" --tags "Manhwa/RPG" --tags "Manga/RPG" --tags "Manga/Isekai" --tags "Manga/Tensei" --tags "1/22/333" > output.xml
cat output.xml | sed 's/^[ \t]*//' | sed ':a;N;$!ba;s/\n//g' > output_minify.xml

Arch Linux (KDE Plasma)

StarGeek

Quote from: ArchZu on September 12, 2024, 04:27:20 AMDigikam writes one way, it seems to use exiv2 to write 'x:xmptk="XMP Core 4.4.0-Exiv2"'. exiftool is recording the data differently.

Both are legitimate XMP. One uses the newer, short, and compact way of writing, exiftool uses the older, more expansive way by default. The older way is often more compatible, especially with apps that don't have large companies behind them. Adobe, ACDSee, and such shouldn't have problems with either version.

You can customize the way exiftool writes XMP in a variety of ways using the -api Compact option. Try
-api Compact=OneDesc
or
-api Compact=AllFormat

Also note that this is XMP, not XML. XMP is based upon XML, but has differences in the formatting. At least, that's my understanding based on previous comments by Phil. I haven't taken the time to figure out the actual differences. That's something I should look at and try to find a webpage that explains it and that I can link to in the future.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).