]> git.sesse.net Git - pr0n/commitdiff
Try XMP-dc:Subject if Keywords does not work. Patch from xim.
authorsgunderson@bigfoot.com <>
Fri, 9 Nov 2012 21:48:10 +0000 (22:48 +0100)
committersgunderson@bigfoot.com <>
Fri, 9 Nov 2012 21:48:10 +0000 (22:48 +0100)
perl/Sesse/pr0n/Common.pm

index 559d6339f38b206498902f801ffa721d777c6593..7375c3cf8f8174a0e90d5753295b1f87895977c5 100644 (file)
@@ -308,6 +308,10 @@ sub update_image_info {
                
                # Tags
                my @tags = $exiftool->GetValue('Keywords', 'ValueConv');
                
                # Tags
                my @tags = $exiftool->GetValue('Keywords', 'ValueConv');
+               if (scalar @tags == 0) {
+                       # This is XMP-dc:Subject, an RDF bag of tags.
+                       @tags = $exiftool->GetValue('Subject', 'ValueConv');
+               }
                $dbh->do('DELETE FROM tags WHERE image=?',
                        undef, $id)
                        or die "Couldn't delete old tag information in SQL: $!";
                $dbh->do('DELETE FROM tags WHERE image=?',
                        undef, $id)
                        or die "Couldn't delete old tag information in SQL: $!";