oozcitak / exiflibrary

A .Net Standard library for editing Exif metadata
MIT License
131 stars 48 forks source link

Can't retrieve WindowsKeywords from (some) jpg /png files #114

Open JohnVKRDam opened 1 year ago

JohnVKRDam commented 1 year ago

ISSUE As the subject says, I can't retrieve the ExifTag.WindowsKeywords property of some jpg/png files.

WHAT I HAVE DONE TO RESEARCH THE ISSUE I have enumerated the available Exif properties for the image file, and the WindowsKeywords property is actually available, but I simply cannot read it from the file. When I do a imgFileTest.Properties.[Get](ExifTag.WindowsKeywords, the string is empty. On other files this returns the tags/keywords perfectly, in a single string.

Other properties from this image do work, like, for instance, imgFileTest.Properties.[Get](ExifTag.ImageDescription), which gives me the "Subject" property of the image file.

SOURCE FILE FOR TESTING The file that doesn't work, is one downloaded, and unedited in any way, from Wikipedia. It is this one: https://en.wikipedia.org/wiki/Sikorsky_UH-60_Black_Hawk#/media/File:UH-60_2nd_Squadron,_2nd_Cavalry_Regiment_(cropped).jpg

WORK-AROUND SOLUTION When I edit the offending image file, and ADD a keyword through [Windows Explorer Right-Click > Properties > Tab: Details > Property: Tags > then add a tag, Apply, and Save the image], then when I try my code again, it DOES retrieve the keywords through the ExifTag.WindowsKeywords property. So, apparently something is "reset" when I save the image, which then enables this library to read this particular property.

OTHER REMARKS I would say it is a problem with the code, seeing how other programs can retrieve the Tags without issue. For example, the application "Advanced Renamer" (I use the free version, version 3.88). This application has a built-in Exit Tag tool (based on the ExifTool by Phil Harvey, website: exiftool.org). And, of course, the Windows Explorer has no issues with the image either.

FINAL MENTION I really hope this Code is still maintained, although it looks like it isn't, and not dead? It is exactly what I was looking for, and I was so happy when I found it, except of course for the issues I'm experiencing ;)

JohnVKRDam commented 1 year ago

Guess not... ah well...

I'm now on the lookout for another .NET Exif library that is still maintained and actually works? Anyone have any suggestions? Would be highly appreciated! Thanks in advance!