From 1e0f8381cf9ed1788fd24d9a0ee1b8a7d198abdc Mon Sep 17 00:00:00 2001 From: Ozgur Ozcitak Date: Sat, 2 Apr 2022 18:20:21 +0300 Subject: [PATCH] Add test for #94 --- UnitTests/Issues.cs | 22 ++++++++++++++++++++++ UnitTests/TestImages/issue-94.jpg | Bin 0 -> 631 bytes 2 files changed, 22 insertions(+) create mode 100644 UnitTests/TestImages/issue-94.jpg diff --git a/UnitTests/Issues.cs b/UnitTests/Issues.cs index 557419a..8411e37 100644 --- a/UnitTests/Issues.cs +++ b/UnitTests/Issues.cs @@ -55,6 +55,28 @@ public void Issue79() Assert.Null(exception); } + [Fact(DisplayName = "Windows Explorer doesn't recognize the Long/Lat ref")] + public void Issue94() + { + var image = ImageFile.FromFile(TestHelpers.TestImagePath(".", "issue-94.jpg")); + image.Properties.Set(new GPSLatitudeLongitude(ExifTag.GPSLatitude, new[] + { + new MathEx.UFraction32(33), + new MathEx.UFraction32(52), + new MathEx.UFraction32(979, 45) + })); + var latRef = new Random().NextDouble() < 0.5 ? GPSLatitudeRef.North : GPSLatitudeRef.South; + image.Properties.Set(ExifTag.GPSLatitudeRef, latRef); + + // read back + var latRef2 = image.Properties.Get>(ExifTag.GPSLatitudeRef); + Assert.Equal(latRef2.Value, latRef); + + // note that this doesn't obviously test windows explorer, just that the tag is written and read properly + // this issue is due to windows explorer only having a fixed set of tags to display as discussed here: + // https://exiftool.org/forum/index.php?topic=6201.0 + } + [Fact(DisplayName = "Imprecision results from inconsistent use of Float vs Rational in reading & writing GPS lat/long")] public void Issue95() { diff --git a/UnitTests/TestImages/issue-94.jpg b/UnitTests/TestImages/issue-94.jpg new file mode 100644 index 0000000000000000000000000000000000000000..e13a47478244eb7865c1a924af3ceaa0d8f4063c GIT binary patch literal 631 zcmex= zRY=j$kxe)-kzJ`!#HexNLJno8jR!@8E`CrkPAY2R|V^&07y2J$~}^+4C1KUw!=a z`ODXD-+%o41@ado12e>1aG#<1OAzQUCSV+}u!H=?$W#u*%z`YeiiT`Lj)Clng~Cck zjT|CQ6Blkg$f;}`^g%SK=pvVxipfLOk07sseMX$en#l4Q++zrT-D2QjW&}navmk># O!{0xPx-^*o-vj{an8A?% literal 0 HcmV?d00001