oozcitak / exiflibrary

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

Property WindowsComment not read by Windows #97

Open extellior opened 2 years ago

extellior commented 2 years ago

Hi, I need help or clarification with 2 issues. The first seems like a bug or oversight, while the second is probably just my own unfamiliarity.

  1. The WindowsComment property isn't read by Windows that I can see. I can populate it, and even read that property back with your sample Exif Test application. But Windows itself doesn't see the value, nor can I find any other way to populate the "Comments" property that Windows is able to see/read. See screenshot.

screenshot exif problem

  1. The WindowsTitle property isn't see by Windows as the Title. Instead, Windows pulls from the property "ImageDescription" to get what it shows as the Title.

My Questions

How do I populate whatever field it is that Windows treats as the Comment?

If Windows treats the Description as the "title", it seems like the "WindowsTitle" property is actually ignored by Windows, so what is its point or use?

Additional Information

I'm still new to working with EXIF data so please forgive me. Out of curiosity, I looked at the image metadata in Gimp. It doesn't show WindowsAuthor, WindowsComment etc. Instead, it shows XPAuthor, XPComment etc. I am guessing that is just their own terminology.

I then looked at the image metadata in Affinity Photo, which provides a "raw" view that I'll share here in case it helps:

<?xpacket begin="" id="W5M0MpCehiHzreSzNTczkc9d"?>
<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="XMP Core 5.5.0">
   <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
      <rdf:Description rdf:about=""
            xmlns:aux="http://ns.adobe.com/exif/1.0/aux/"
            xmlns:dc="http://purl.org/dc/elements/1.1/"
            xmlns:exif="http://ns.adobe.com/exif/1.0/"
            xmlns:exifEX="http://cipa.jp/exif/1.0/"
            xmlns:tiff="http://ns.adobe.com/tiff/1.0/"
            xmlns:xmp="http://ns.adobe.com/xap/1.0/"
            xmlns:serifExifExt="http://xmlns.seriflabs.com/1.0/exifExt"
            xmlns:photoshop="http://ns.adobe.com/photoshop/1.0/">
         <aux:Lens>0.0 - 1.4 mm</aux:Lens>
         <dc:description>
            <rdf:Alt>
               <rdf:li xml:lang="x-default">Best burger in the universe!</rdf:li>
            </rdf:Alt>
         </dc:description>
         <dc:title>
            <rdf:Alt>
               <rdf:li xml:lang="x-default">My Title</rdf:li>
            </rdf:Alt>
         </dc:title>
         <dc:creator>
            <rdf:Seq>
               <rdf:li>My Author</rdf:li>
            </rdf:Seq>
         </dc:creator>
         <exif:ApertureValue>14819/5375</exif:ApertureValue>
         <exif:ColorSpace>1</exif:ColorSpace>
         <exif:ComponentsConfiguration>
            <rdf:Seq>
               <rdf:li>1</rdf:li>
               <rdf:li>2</rdf:li>
               <rdf:li>3</rdf:li>
               <rdf:li>0</rdf:li>
            </rdf:Seq>
         </exif:ComponentsConfiguration>
         <exif:CompressedBitsPerPixel>5/1</exif:CompressedBitsPerPixel>
         <exif:Contrast>1</exif:Contrast>
         <exif:CustomRendered>0</exif:CustomRendered>
         <exif:DateTimeOriginal>2009-06-26T17:33:20</exif:DateTimeOriginal>
         <exif:DigitalZoomRatio>1/1</exif:DigitalZoomRatio>
         <exif:ExifVersion>0220</exif:ExifVersion>
         <exif:ExposureBiasValue>0/1</exif:ExposureBiasValue>
         <exif:ExposureMode>0</exif:ExposureMode>
         <exif:ExposureTime>1/60</exif:ExposureTime>
         <exif:FNumber>13/5</exif:FNumber>
         <exif:FileSource>3</exif:FileSource>
         <exif:Flash rdf:parseType="Resource">
            <exif:Fired>True</exif:Fired>
            <exif:Function>False</exif:Function>
            <exif:Mode>3</exif:Mode>
            <exif:RedEyeMode>False</exif:RedEyeMode>
            <exif:Return>0</exif:Return>
         </exif:Flash>
         <exif:FlashpixVersion>0100</exif:FlashpixVersion>
         <exif:FocalLength>29/5</exif:FocalLength>
         <exif:FocalPlaneResolutionUnit>2</exif:FocalPlaneResolutionUnit>
         <exif:FocalPlaneXResolution>40960/3</exif:FocalPlaneXResolution>
         <exif:FocalPlaneYResolution>2304000/169</exif:FocalPlaneYResolution>
         <exif:ISOSpeedRatings>
            <rdf:Seq>
               <rdf:li>80</rdf:li>
            </rdf:Seq>
         </exif:ISOSpeedRatings>
         <exif:ImageUniqueID/>
         <exif:MaxApertureValue>14819/5375</exif:MaxApertureValue>
         <exif:MeteringMode>5</exif:MeteringMode>
         <exif:PixelXDimension>3072</exif:PixelXDimension>
         <exif:PixelYDimension>2304</exif:PixelYDimension>
         <exif:Saturation>2</exif:Saturation>
         <exif:SceneCaptureType>2</exif:SceneCaptureType>
         <exif:SensingMethod>2</exif:SensingMethod>
         <exif:Sharpness>2</exif:Sharpness>
         <exif:ShutterSpeedValue>23917/4049</exif:ShutterSpeedValue>
         <exif:UserComment>
            <rdf:Alt>
               <rdf:li xml:lang="x-default"/>
            </rdf:Alt>
         </exif:UserComment>
         <exif:WhiteBalance>0</exif:WhiteBalance>
         <exifEX:CameraOwnerName/>
         <exifEX:InteroperabilityIndex>R98</exifEX:InteroperabilityIndex>
         <exifEX:LensModel>0.0 - 1.4 mm</exifEX:LensModel>
         <tiff:BitsPerSample>
            <rdf:Seq>
               <rdf:li>8</rdf:li>
            </rdf:Seq>
         </tiff:BitsPerSample>
         <tiff:Compression>6</tiff:Compression>
         <tiff:ImageLength>2304</tiff:ImageLength>
         <tiff:ImageWidth>3072</tiff:ImageWidth>
         <tiff:Make>Canon</tiff:Make>
         <tiff:Model>Canon PowerShot A570 IS</tiff:Model>
         <tiff:Orientation>1</tiff:Orientation>
         <tiff:ResolutionUnit>2</tiff:ResolutionUnit>
         <tiff:XResolution>180/1</tiff:XResolution>
         <tiff:YCbCrPositioning>1</tiff:YCbCrPositioning>
         <tiff:YCbCrSubSampling>
            <rdf:Seq>
               <rdf:li>2</rdf:li>
               <rdf:li>1</rdf:li>
            </rdf:Seq>
         </tiff:YCbCrSubSampling>
         <tiff:YResolution>180/1</tiff:YResolution>
         <xmp:CreateDate>2009-06-26T17:33:20</xmp:CreateDate>
         <xmp:ModifyDate>2009-06-26T17:33:20</xmp:ModifyDate>
         <serifExifExt:XPComment>My Comment</serifExifExt:XPComment>
         <serifExifExt:XPSubject>My Subject</serifExifExt:XPSubject>
         <photoshop:ColorMode>3</photoshop:ColorMode>
         <photoshop:ICCProfile>sRGB IEC61966-2.1</photoshop:ICCProfile>
      </rdf:Description>
   </rdf:RDF>
</x:xmpmeta>
<?xpacket end="r"?>

My test code is very simple:

                var file = ImageFile.FromFile(source);
                file.Properties.Set(ExifTag.WindowsAuthor, "My Author");              
                file.Properties.Set(ExifTag.WindowsComment, "My Comment");
                file.Properties.Set(ExifTag.WindowsTitle, "My Title");
                file.Properties.Set(ExifTag.WindowsSubject, "My Subject");

                if (String.IsNullOrEmpty(dest))
                    dest = source;

                file.Save(dest);

Recap

How do I populate whatever field it is that Windows treats as the Comment?

If Windows treats the Description as the "title", it seems like the "WindowsTitle" property is actually ignored by Windows, so what is its point or use?

UPDATE

I can't explain how or why, but suddenly being able to read the XPComment started working. You can see clearly in my screenshot that it wasn't working right. So I can prove that it didn't work right before, but have no idea why suddenly everything seems OK.