diff --git a/MetadataExtractor/Formats/Exif/ExifDescriptorBase.cs b/MetadataExtractor/Formats/Exif/ExifDescriptorBase.cs index 10d998425..78189c786 100644 --- a/MetadataExtractor/Formats/Exif/ExifDescriptorBase.cs +++ b/MetadataExtractor/Formats/Exif/ExifDescriptorBase.cs @@ -21,6 +21,12 @@ public abstract class ExifDescriptorBase(T directory) TagInteropVersion => GetInteropVersionDescription(), TagOrientation => GetOrientationDescription(), TagResolutionUnit => GetResolutionDescription(), + TagTemperature => GetTemperatureDescription(), + TagHumidity => GetHumidityDescription(), + TagPressure => GetPressureDescription(), + TagWaterDepth => GetWaterDepthDescription(), + TagAcceleration => GetAccelerationDescription(), + TagCameraElevationAngle => GetCameraElevationAngleDescription(), TagYCbCrPositioning => GetYCbCrPositioningDescription(), TagXResolution => GetXResolutionDescription(), TagYResolution => GetYResolutionDescription(), @@ -164,6 +170,60 @@ public abstract class ExifDescriptorBase(T directory) "cm"); } + public string? GetTemperatureDescription() + { + if (!Directory.TryGetRational(TagTemperature, out Rational value)) + return null; + if (value.Denominator == 0xFFFFFFFFL) + return "Unknown"; + return $"{value.ToDouble():0.0} °C"; + } + + public string? GetHumidityDescription() + { + if (!Directory.TryGetRational(TagHumidity, out Rational value)) + return null; + if (value.Denominator == 0xFFFFFFFFL) + return "Unknown"; + return $"{value.ToDouble():0.0} %"; + } + + public string? GetPressureDescription() + { + if (!Directory.TryGetRational(TagPressure, out Rational value)) + return null; + if (value.Denominator == 0xFFFFFFFFL) + return "Unknown"; + return $"{value.ToDouble():0.0} hPa"; + } + + public string? GetWaterDepthDescription() + { + if (!Directory.TryGetRational(TagWaterDepth, out Rational value)) + return null; + if (value.Denominator == 0xFFFFFFFFL) + return "Unknown"; + return $"{value.ToDouble():0.0##} metres"; + } + + public string? GetAccelerationDescription() + { + if (!Directory.TryGetRational(TagAcceleration, out Rational value)) + return null; + if (value.Denominator == 0xFFFFFFFFL) + return "Unknown"; + return $"{value.ToDouble():0.0##} mGal"; + } + + public string? GetCameraElevationAngleDescription() + { + if (!Directory.TryGetRational(TagCameraElevationAngle, out Rational value)) + return null; + if (value.Denominator == 0xFFFFFFFFL) + return "Unknown"; + return $"{value.ToDouble():0.##} degrees"; + } + /// The Windows specific tags uses plain Unicode. private string? GetUnicodeDescription(int tag) { diff --git a/MetadataExtractor/Formats/Exif/ExifDirectoryBase.cs b/MetadataExtractor/Formats/Exif/ExifDirectoryBase.cs index e7d9613b9..ffbbd104e 100644 --- a/MetadataExtractor/Formats/Exif/ExifDirectoryBase.cs +++ b/MetadataExtractor/Formats/Exif/ExifDirectoryBase.cs @@ -437,6 +437,13 @@ public abstract class ExifDirectoryBase : Directory public const int TagSubsecondTimeDigitized = 0x9292; + public const int TagTemperature = 0x9400; + public const int TagHumidity = 0x9401; + public const int TagPressure = 0x9402; + public const int TagWaterDepth = 0x9403; + public const int TagAcceleration = 0x9404; + public const int TagCameraElevationAngle = 0x9405; + /// The image title, as used by Windows XP. public const int TagWinTitle = 0x9C9B; @@ -862,6 +869,12 @@ protected static void AddExifTagNames(Dictionary map) map[TagSubsecondTime] = "Sub-Sec Time"; map[TagSubsecondTimeOriginal] = "Sub-Sec Time Original"; map[TagSubsecondTimeDigitized] = "Sub-Sec Time Digitized"; + map[TagTemperature] = "Temperature"; + map[TagHumidity] = "Humidity"; + map[TagPressure] = "Pressure"; + map[TagWaterDepth] = "Water Depth"; + map[TagAcceleration] = "Acceleration"; + map[TagCameraElevationAngle] = "Camera Elevation Angle"; map[TagWinTitle] = "Windows XP Title"; map[TagWinComment] = "Windows XP Comment"; map[TagWinAuthor] = "Windows XP Author"; diff --git a/MetadataExtractor/PublicAPI/net8.0/PublicAPI.Unshipped.txt b/MetadataExtractor/PublicAPI/net8.0/PublicAPI.Unshipped.txt index 24d81ad44..2d7a6fbe4 100644 --- a/MetadataExtractor/PublicAPI/net8.0/PublicAPI.Unshipped.txt +++ b/MetadataExtractor/PublicAPI/net8.0/PublicAPI.Unshipped.txt @@ -1,6 +1,12 @@ #nullable enable abstract MetadataExtractor.IO.IndexedReader.GetBytes(int index, System.Span bytes) -> void abstract MetadataExtractor.IO.SequentialReader.GetBytes(System.Span bytes) -> void +const MetadataExtractor.Formats.Exif.ExifDirectoryBase.TagAcceleration = 37892 -> int +const MetadataExtractor.Formats.Exif.ExifDirectoryBase.TagCameraElevationAngle = 37893 -> int +const MetadataExtractor.Formats.Exif.ExifDirectoryBase.TagHumidity = 37889 -> int +const MetadataExtractor.Formats.Exif.ExifDirectoryBase.TagPressure = 37890 -> int +const MetadataExtractor.Formats.Exif.ExifDirectoryBase.TagTemperature = 37888 -> int +const MetadataExtractor.Formats.Exif.ExifDirectoryBase.TagWaterDepth = 37891 -> int const MetadataExtractor.Formats.Exif.Makernotes.AppleMakernoteDirectory.TagAEAverage = 6 -> int const MetadataExtractor.Formats.Exif.Makernotes.AppleMakernoteDirectory.TagAEMatrix = 2 -> int const MetadataExtractor.Formats.Exif.Makernotes.AppleMakernoteDirectory.TagAEStable = 4 -> int @@ -75,6 +81,12 @@ MetadataExtractor.Formats.Apple.BplistReader.BplistReader() -> void MetadataExtractor.Formats.Apple.BplistReader.PropertyListResults MetadataExtractor.Formats.Apple.BplistReader.PropertyListResults.Get(byte key) -> object! MetadataExtractor.Formats.Apple.BplistReader.PropertyListResults.GetTopObject() -> System.Collections.Generic.Dictionary? +MetadataExtractor.Formats.Exif.ExifDescriptorBase.GetAccelerationDescription() -> string? +MetadataExtractor.Formats.Exif.ExifDescriptorBase.GetCameraElevationAngleDescription() -> string? +MetadataExtractor.Formats.Exif.ExifDescriptorBase.GetHumidityDescription() -> string? +MetadataExtractor.Formats.Exif.ExifDescriptorBase.GetPressureDescription() -> string? +MetadataExtractor.Formats.Exif.ExifDescriptorBase.GetTemperatureDescription() -> string? +MetadataExtractor.Formats.Exif.ExifDescriptorBase.GetWaterDepthDescription() -> string? MetadataExtractor.Formats.Exif.GpsDirectory.TryGetGeoLocation(out MetadataExtractor.GeoLocation geoLocation) -> bool MetadataExtractor.Formats.Exif.Makernotes.AppleMakernoteDescriptor.GetAEStableDescription() -> string? MetadataExtractor.Formats.Exif.Makernotes.AppleMakernoteDescriptor.GetAFStableDescription() -> string? diff --git a/MetadataExtractor/PublicAPI/netstandard2.0/PublicAPI.Unshipped.txt b/MetadataExtractor/PublicAPI/netstandard2.0/PublicAPI.Unshipped.txt index e62ac80e8..4bea931da 100644 --- a/MetadataExtractor/PublicAPI/netstandard2.0/PublicAPI.Unshipped.txt +++ b/MetadataExtractor/PublicAPI/netstandard2.0/PublicAPI.Unshipped.txt @@ -1,6 +1,12 @@ #nullable enable abstract MetadataExtractor.IO.IndexedReader.GetBytes(int index, System.Span bytes) -> void abstract MetadataExtractor.IO.SequentialReader.GetBytes(System.Span bytes) -> void +const MetadataExtractor.Formats.Exif.ExifDirectoryBase.TagAcceleration = 37892 -> int +const MetadataExtractor.Formats.Exif.ExifDirectoryBase.TagCameraElevationAngle = 37893 -> int +const MetadataExtractor.Formats.Exif.ExifDirectoryBase.TagHumidity = 37889 -> int +const MetadataExtractor.Formats.Exif.ExifDirectoryBase.TagPressure = 37890 -> int +const MetadataExtractor.Formats.Exif.ExifDirectoryBase.TagTemperature = 37888 -> int +const MetadataExtractor.Formats.Exif.ExifDirectoryBase.TagWaterDepth = 37891 -> int const MetadataExtractor.Formats.Exif.Makernotes.AppleMakernoteDirectory.TagAEAverage = 6 -> int const MetadataExtractor.Formats.Exif.Makernotes.AppleMakernoteDirectory.TagAEMatrix = 2 -> int const MetadataExtractor.Formats.Exif.Makernotes.AppleMakernoteDirectory.TagAEStable = 4 -> int @@ -76,6 +82,12 @@ MetadataExtractor.Formats.Apple.BplistReader.BplistReader() -> void MetadataExtractor.Formats.Apple.BplistReader.PropertyListResults MetadataExtractor.Formats.Apple.BplistReader.PropertyListResults.Get(byte key) -> object! MetadataExtractor.Formats.Apple.BplistReader.PropertyListResults.GetTopObject() -> System.Collections.Generic.Dictionary? +MetadataExtractor.Formats.Exif.ExifDescriptorBase.GetAccelerationDescription() -> string? +MetadataExtractor.Formats.Exif.ExifDescriptorBase.GetCameraElevationAngleDescription() -> string? +MetadataExtractor.Formats.Exif.ExifDescriptorBase.GetHumidityDescription() -> string? +MetadataExtractor.Formats.Exif.ExifDescriptorBase.GetPressureDescription() -> string? +MetadataExtractor.Formats.Exif.ExifDescriptorBase.GetTemperatureDescription() -> string? +MetadataExtractor.Formats.Exif.ExifDescriptorBase.GetWaterDepthDescription() -> string? MetadataExtractor.Formats.Exif.GpsDirectory.TryGetGeoLocation(out MetadataExtractor.GeoLocation geoLocation) -> bool MetadataExtractor.Formats.Exif.Makernotes.AppleMakernoteDescriptor.GetAEStableDescription() -> string? MetadataExtractor.Formats.Exif.Makernotes.AppleMakernoteDescriptor.GetAFStableDescription() -> string? diff --git a/MetadataExtractor/PublicAPI/netstandard2.1/PublicAPI.Unshipped.txt b/MetadataExtractor/PublicAPI/netstandard2.1/PublicAPI.Unshipped.txt index 24d81ad44..2d7a6fbe4 100644 --- a/MetadataExtractor/PublicAPI/netstandard2.1/PublicAPI.Unshipped.txt +++ b/MetadataExtractor/PublicAPI/netstandard2.1/PublicAPI.Unshipped.txt @@ -1,6 +1,12 @@ #nullable enable abstract MetadataExtractor.IO.IndexedReader.GetBytes(int index, System.Span bytes) -> void abstract MetadataExtractor.IO.SequentialReader.GetBytes(System.Span bytes) -> void +const MetadataExtractor.Formats.Exif.ExifDirectoryBase.TagAcceleration = 37892 -> int +const MetadataExtractor.Formats.Exif.ExifDirectoryBase.TagCameraElevationAngle = 37893 -> int +const MetadataExtractor.Formats.Exif.ExifDirectoryBase.TagHumidity = 37889 -> int +const MetadataExtractor.Formats.Exif.ExifDirectoryBase.TagPressure = 37890 -> int +const MetadataExtractor.Formats.Exif.ExifDirectoryBase.TagTemperature = 37888 -> int +const MetadataExtractor.Formats.Exif.ExifDirectoryBase.TagWaterDepth = 37891 -> int const MetadataExtractor.Formats.Exif.Makernotes.AppleMakernoteDirectory.TagAEAverage = 6 -> int const MetadataExtractor.Formats.Exif.Makernotes.AppleMakernoteDirectory.TagAEMatrix = 2 -> int const MetadataExtractor.Formats.Exif.Makernotes.AppleMakernoteDirectory.TagAEStable = 4 -> int @@ -75,6 +81,12 @@ MetadataExtractor.Formats.Apple.BplistReader.BplistReader() -> void MetadataExtractor.Formats.Apple.BplistReader.PropertyListResults MetadataExtractor.Formats.Apple.BplistReader.PropertyListResults.Get(byte key) -> object! MetadataExtractor.Formats.Apple.BplistReader.PropertyListResults.GetTopObject() -> System.Collections.Generic.Dictionary? +MetadataExtractor.Formats.Exif.ExifDescriptorBase.GetAccelerationDescription() -> string? +MetadataExtractor.Formats.Exif.ExifDescriptorBase.GetCameraElevationAngleDescription() -> string? +MetadataExtractor.Formats.Exif.ExifDescriptorBase.GetHumidityDescription() -> string? +MetadataExtractor.Formats.Exif.ExifDescriptorBase.GetPressureDescription() -> string? +MetadataExtractor.Formats.Exif.ExifDescriptorBase.GetTemperatureDescription() -> string? +MetadataExtractor.Formats.Exif.ExifDescriptorBase.GetWaterDepthDescription() -> string? MetadataExtractor.Formats.Exif.GpsDirectory.TryGetGeoLocation(out MetadataExtractor.GeoLocation geoLocation) -> bool MetadataExtractor.Formats.Exif.Makernotes.AppleMakernoteDescriptor.GetAEStableDescription() -> string? MetadataExtractor.Formats.Exif.Makernotes.AppleMakernoteDescriptor.GetAFStableDescription() -> string?