oozcitak / exiflibrary

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

Windows Explorer doesn't recognize the Long/Lat ref #94

Closed extellior closed 2 years ago

extellior commented 2 years ago

Windows Explorer can read the longitude & latitude coordinates written by this, but it doesn't pick up on the N/S or E/W in my tests so far.

I'm ultimately consuming this in a VB.NET Framework program using my own C# DLL on .NET Standard 2.0 as a go-between.

I just pass a simple string char to my DLL and it does the conversion and saves, like so:

                var file = ImageFile.FromFile(source);

                GPSLatitudeRef gpslatref = new GPSLatitudeRef();
                if (latref == "N")
                {
                    gpslatref = GPSLatitudeRef.North;
                }
                if (latref == "S")
                {
                    gpslatref = GPSLatitudeRef.South;
                }

                GPSLongitudeRef gpslongref = new GPSLongitudeRef();
                if (longref == "E")
                {
                    gpslongref = GPSLongitudeRef.East;
                }
                if (longref == "W")
                {
                    gpslongref = GPSLongitudeRef.West;
                }

                // write new values

                file.Properties.Set(ExifTag.GPSLatitude, latdeg, latmin, latsec);
                file.Properties.Set(ExifTag.GPSLongitude, longdeg, longmin, longsec);
                file.Properties.Set(ExifTag.GPSLatitudeRef, gpslatref);
                file.Properties.Set(ExifTag.GPSLongitudeRef, gpslongref);
                if (String.IsNullOrEmpty(dest))
                {
                    dest = source;
                }
                file.Save(dest);

Is there any trick that will get Windows Explorer to see the lat/long refs?

oozcitak commented 2 years ago

This seems to be an explorer issue as discussed here: https://exiftool.org/forum/index.php?topic=6201.0

image

Applying the registry fix in the thread adds the hemisphere tags to the details pane:

image