From 60df9625ee9768555b6cc1b3aabdb8ff43bbbaa9 Mon Sep 17 00:00:00 2001 From: Drew Noakes Date: Tue, 13 Feb 2024 00:32:06 +1100 Subject: [PATCH] Use named arguments --- MetadataExtractor/Formats/Flir/FlirReader.cs | 4 ++- .../Formats/Tiff/TiffDataFormat.cs | 30 +++++++++---------- 2 files changed, 18 insertions(+), 16 deletions(-) diff --git a/MetadataExtractor/Formats/Flir/FlirReader.cs b/MetadataExtractor/Formats/Flir/FlirReader.cs index 4ac2d3e29..2df29c9fc 100644 --- a/MetadataExtractor/Formats/Flir/FlirReader.cs +++ b/MetadataExtractor/Formats/Flir/FlirReader.cs @@ -169,7 +169,9 @@ public IEnumerable Extract(IndexedReader reader) var tm = dateTimeReader.GetUInt32(); var ss = dateTimeReader.GetUInt32() & 0xffff; var tz = dateTimeReader.GetInt16(); - directory.Set(TagDateTimeOriginal, new DateTimeOffset(DateUtil.FromUnixTime(tm - tz * 60).AddSeconds(ss / 1000d), TimeSpan.FromMinutes(tz))); + directory.Set(TagDateTimeOriginal, new DateTimeOffset( + dateTime: DateUtil.FromUnixTime(tm - tz * 60).AddSeconds(ss / 1000d), + offset: TimeSpan.FromMinutes(tz))); directory.Set(TagFocusStepCount, reader2.GetUInt16(TagFocusStepCount)); directory.Set(TagFocusDistance, reader2.GetFloat32(TagFocusDistance)); diff --git a/MetadataExtractor/Formats/Tiff/TiffDataFormat.cs b/MetadataExtractor/Formats/Tiff/TiffDataFormat.cs index 3092505fa..296635de4 100644 --- a/MetadataExtractor/Formats/Tiff/TiffDataFormat.cs +++ b/MetadataExtractor/Formats/Tiff/TiffDataFormat.cs @@ -28,23 +28,23 @@ public enum TiffDataFormatCode : ushort public sealed class TiffDataFormat { #pragma warning disable format - public static readonly TiffDataFormat Int8U = new("BYTE", TiffDataFormatCode.Int8U, 1); - public static readonly TiffDataFormat String = new("STRING", TiffDataFormatCode.String, 1); - public static readonly TiffDataFormat Int16U = new("USHORT", TiffDataFormatCode.Int16U, 2); - public static readonly TiffDataFormat Int32U = new("ULONG", TiffDataFormatCode.Int32U, 4); - public static readonly TiffDataFormat RationalU = new("URATIONAL", TiffDataFormatCode.RationalU, 8); - public static readonly TiffDataFormat Int8S = new("SBYTE", TiffDataFormatCode.Int8S, 1); - public static readonly TiffDataFormat Undefined = new("UNDEFINED", TiffDataFormatCode.Undefined, 1); - public static readonly TiffDataFormat Int16S = new("SSHORT", TiffDataFormatCode.Int16S, 2); - public static readonly TiffDataFormat Int32S = new("SLONG", TiffDataFormatCode.Int32S, 4); - public static readonly TiffDataFormat RationalS = new("SRATIONAL", TiffDataFormatCode.RationalS, 8); - public static readonly TiffDataFormat Single = new("SINGLE", TiffDataFormatCode.Single, 4); - public static readonly TiffDataFormat Double = new("DOUBLE", TiffDataFormatCode.Double, 8); + public static readonly TiffDataFormat Int8U = new("BYTE", TiffDataFormatCode.Int8U, componentSizeBytes: 1); + public static readonly TiffDataFormat String = new("STRING", TiffDataFormatCode.String, componentSizeBytes: 1); + public static readonly TiffDataFormat Int16U = new("USHORT", TiffDataFormatCode.Int16U, componentSizeBytes: 2); + public static readonly TiffDataFormat Int32U = new("ULONG", TiffDataFormatCode.Int32U, componentSizeBytes: 4); + public static readonly TiffDataFormat RationalU = new("URATIONAL", TiffDataFormatCode.RationalU, componentSizeBytes: 8); + public static readonly TiffDataFormat Int8S = new("SBYTE", TiffDataFormatCode.Int8S, componentSizeBytes: 1); + public static readonly TiffDataFormat Undefined = new("UNDEFINED", TiffDataFormatCode.Undefined, componentSizeBytes: 1); + public static readonly TiffDataFormat Int16S = new("SSHORT", TiffDataFormatCode.Int16S, componentSizeBytes: 2); + public static readonly TiffDataFormat Int32S = new("SLONG", TiffDataFormatCode.Int32S, componentSizeBytes: 4); + public static readonly TiffDataFormat RationalS = new("SRATIONAL", TiffDataFormatCode.RationalS, componentSizeBytes: 8); + public static readonly TiffDataFormat Single = new("SINGLE", TiffDataFormatCode.Single, componentSizeBytes: 4); + public static readonly TiffDataFormat Double = new("DOUBLE", TiffDataFormatCode.Double, componentSizeBytes: 8); // From BigTIFF - public static readonly TiffDataFormat Int64U = new("ULONG8", TiffDataFormatCode.Int64U, 8); - public static readonly TiffDataFormat Int64S = new("SLONG8", TiffDataFormatCode.Int64S, 8); - public static readonly TiffDataFormat Ifd8 = new("IFD8", TiffDataFormatCode.Ifd8, 8); + public static readonly TiffDataFormat Int64U = new("ULONG8", TiffDataFormatCode.Int64U, componentSizeBytes: 8); + public static readonly TiffDataFormat Int64S = new("SLONG8", TiffDataFormatCode.Int64S, componentSizeBytes: 8); + public static readonly TiffDataFormat Ifd8 = new("IFD8", TiffDataFormatCode.Ifd8, componentSizeBytes: 8); #pragma warning restore format public static TiffDataFormat? FromTiffFormatCode(TiffDataFormatCode tiffFormatCode, bool isBigTiff)