diff --git a/Annotations.cs b/Annotations.cs index bbdb5dd42..ef40d1919 100644 --- a/Annotations.cs +++ b/Annotations.cs @@ -2,7 +2,7 @@ // Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -#if NETFRAMEWORK || NETSTANDARD1_3 +#if NETSTANDARD2_0 namespace System.Diagnostics.CodeAnalysis { diff --git a/Directory.Build.props b/Directory.Build.props index 57f1c498b..5f949df3d 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -21,13 +21,12 @@ true + + net8.0 - - - diff --git a/MetadataExtractor.Benchmarks/MetadataExtractor.Benchmarks.csproj b/MetadataExtractor.Benchmarks/MetadataExtractor.Benchmarks.csproj index f9a83babe..c4f664d9b 100644 --- a/MetadataExtractor.Benchmarks/MetadataExtractor.Benchmarks.csproj +++ b/MetadataExtractor.Benchmarks/MetadataExtractor.Benchmarks.csproj @@ -1,7 +1,7 @@  - net461 + $(ModernDotNetTargetFrameworkAlias) Exe @@ -13,15 +13,4 @@ - - - - - - - - - - - diff --git a/MetadataExtractor.Benchmarks/Program.cs b/MetadataExtractor.Benchmarks/Program.cs index 592c21493..cd7f59f88 100644 --- a/MetadataExtractor.Benchmarks/Program.cs +++ b/MetadataExtractor.Benchmarks/Program.cs @@ -1,12 +1,15 @@ // Copyright (c) Drew Noakes and contributors. All Rights Reserved. Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using System.Drawing; -using System.Text.RegularExpressions; using BenchmarkDotNet.Attributes; using BenchmarkDotNet.Running; using MetadataExtractor.Formats.Exif; using MetadataExtractor.Formats.Jpeg; + +#if !NET +using System.Drawing; +using System.Text.RegularExpressions; using System.Windows.Media.Imaging; +#endif namespace MetadataExtractor.Benchmarks { @@ -108,6 +111,7 @@ public DateTime ImageMetadataReaderBenchmark() return subIfdDirectory.GetDateTime(ExifDirectoryBase.TagDateTimeOriginal); } +#if !NET private readonly Regex _dateTimeRegex = new Regex(":"); [Benchmark] @@ -145,5 +149,6 @@ public DateTime WpfJpegBitmapDecoderBenchmark() var dateTakenStr = (string)metadata.GetQuery("/app1/ifd/exif/subifd:{uint=36867}"); return DateTime.Parse(_dateTimeRegex.Replace(dateTakenStr, "-", count: 2)); } +#endif } } diff --git a/MetadataExtractor.Tests/MetadataExtractor.Tests.csproj b/MetadataExtractor.Tests/MetadataExtractor.Tests.csproj index 532f6f7e3..6f4ce8c69 100644 --- a/MetadataExtractor.Tests/MetadataExtractor.Tests.csproj +++ b/MetadataExtractor.Tests/MetadataExtractor.Tests.csproj @@ -1,7 +1,7 @@  - net8.0;net472 + $(ModernDotNetTargetFrameworkAlias);net472 MetadataExtractor diff --git a/MetadataExtractor.Tools.FileProcessor/DeconstructionExtensions.cs b/MetadataExtractor.Tools.FileProcessor/DeconstructionExtensions.cs index 284422b9f..782384538 100644 --- a/MetadataExtractor.Tools.FileProcessor/DeconstructionExtensions.cs +++ b/MetadataExtractor.Tools.FileProcessor/DeconstructionExtensions.cs @@ -2,6 +2,8 @@ #if NETFRAMEWORK +#pragma warning disable IDE0130 // Namespace does not match folder structure + namespace System.Collections.Generic; internal static class DeconstructionExtensions diff --git a/MetadataExtractor.Tools.FileProcessor/MetadataExtractor.Tools.FileProcessor.csproj b/MetadataExtractor.Tools.FileProcessor/MetadataExtractor.Tools.FileProcessor.csproj index a4ded842e..6d8f41730 100644 --- a/MetadataExtractor.Tools.FileProcessor/MetadataExtractor.Tools.FileProcessor.csproj +++ b/MetadataExtractor.Tools.FileProcessor/MetadataExtractor.Tools.FileProcessor.csproj @@ -1,11 +1,11 @@  - net8.0;net48 + $(ModernDotNetTargetFrameworkAlias);net48 Exe - + true true true diff --git a/MetadataExtractor.Tools.JpegSegmentExtractor/MetadataExtractor.Tools.JpegSegmentExtractor.csproj b/MetadataExtractor.Tools.JpegSegmentExtractor/MetadataExtractor.Tools.JpegSegmentExtractor.csproj index cf556da55..0f53c4c5f 100644 --- a/MetadataExtractor.Tools.JpegSegmentExtractor/MetadataExtractor.Tools.JpegSegmentExtractor.csproj +++ b/MetadataExtractor.Tools.JpegSegmentExtractor/MetadataExtractor.Tools.JpegSegmentExtractor.csproj @@ -1,7 +1,7 @@  - net6.0 + $(ModernDotNetTargetFrameworkAlias) Exe diff --git a/MetadataExtractor/Formats/Exif/ExifTiffHandler.cs b/MetadataExtractor/Formats/Exif/ExifTiffHandler.cs index 7b1c4ebff..551d14534 100644 --- a/MetadataExtractor/Formats/Exif/ExifTiffHandler.cs +++ b/MetadataExtractor/Formats/Exif/ExifTiffHandler.cs @@ -538,11 +538,7 @@ private bool ProcessMakernote(in TiffReaderContext context, int makernoteOffset) PushDirectory(new OlympusMakernoteDirectory()); TiffReader.ProcessIfd(this, context, ifdOffset: makernoteOffset); } -#if NETSTANDARD1_3 || NET462 - else if (cameraMake is not null && cameraMake.TrimStart().StartsWith("NIKON", StringComparison.OrdinalIgnoreCase)) -#else - else if (cameraMake is not null && cameraMake.AsSpan().TrimStart().StartsWith("NIKON", StringComparison.OrdinalIgnoreCase)) -#endif + else if (cameraMake is not null && cameraMake.AsSpan().TrimStart().StartsWith("NIKON".AsSpan(), StringComparison.OrdinalIgnoreCase)) { if (headerBytes.StartsWith("Nikon"u8)) { diff --git a/MetadataExtractor/Formats/Icc/IccDescriptor.cs b/MetadataExtractor/Formats/Icc/IccDescriptor.cs index f62dfafb8..095cc583d 100644 --- a/MetadataExtractor/Formats/Icc/IccDescriptor.cs +++ b/MetadataExtractor/Formats/Icc/IccDescriptor.cs @@ -56,15 +56,15 @@ private enum IccTagType { case IccTagType.Text: { -#if !NETSTANDARD1_3 + Span textBytes = bytes.AsSpan(start: 8, length: bytes.Length - 8 - 1); + try { - return Encoding.ASCII.GetString(bytes, 8, bytes.Length - 8 - 1); + return Encoding.ASCII.GetString(textBytes); } catch -#endif { - return Encoding.UTF8.GetString(bytes, 8, bytes.Length - 8 - 1); + return Encoding.UTF8.GetString(textBytes); } } diff --git a/MetadataExtractor/Formats/Iptc/Iso2022Converter.cs b/MetadataExtractor/Formats/Iptc/Iso2022Converter.cs index e49d08d3a..e6803feda 100644 --- a/MetadataExtractor/Formats/Iptc/Iso2022Converter.cs +++ b/MetadataExtractor/Formats/Iptc/Iso2022Converter.cs @@ -61,11 +61,7 @@ public static class Iso2022Converter if (ascii) { -#if NETSTANDARD1_3 - return Encoding.UTF8; -#else return Encoding.ASCII; -#endif } var utf8 = false; @@ -97,7 +93,7 @@ public static class Iso2022Converter { int charCount = encoding.GetChars(bytes, 0, bytes.Length, charBuffer, 0); - if (charBuffer.AsSpan(0, charCount).IndexOf((char)65533) != -1) + if (charBuffer.AsSpan(0, charCount).IndexOf((char)0xFFFD) != -1) continue; return encoding; } diff --git a/MetadataExtractor/Formats/Jpeg/JpegComponent.cs b/MetadataExtractor/Formats/Jpeg/JpegComponent.cs index c8be245e0..1af307857 100644 --- a/MetadataExtractor/Formats/Jpeg/JpegComponent.cs +++ b/MetadataExtractor/Formats/Jpeg/JpegComponent.cs @@ -7,7 +7,7 @@ namespace MetadataExtractor.Formats.Jpeg /// quantization table number. /// /// Drew Noakes https://drewnoakes.com -#if !NETSTANDARD1_3 +#if !NET8_0_OR_GREATER [Serializable] #endif public sealed class JpegComponent diff --git a/MetadataExtractor/Formats/Jpeg/JpegProcessingException.cs b/MetadataExtractor/Formats/Jpeg/JpegProcessingException.cs index 0874adc54..8c7ecf12f 100644 --- a/MetadataExtractor/Formats/Jpeg/JpegProcessingException.cs +++ b/MetadataExtractor/Formats/Jpeg/JpegProcessingException.cs @@ -1,6 +1,6 @@ // Copyright (c) Drew Noakes and contributors. All Rights Reserved. Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -#if !NETSTANDARD1_3 && !NET8_0_OR_GREATER +#if !NET8_0_OR_GREATER using System.Runtime.Serialization; #endif @@ -8,7 +8,7 @@ namespace MetadataExtractor.Formats.Jpeg { /// An exception class thrown upon unexpected and fatal conditions while processing a JPEG file. /// Drew Noakes https://drewnoakes.com -#if !NETSTANDARD1_3 && !NET8_0_OR_GREATER +#if !NET8_0_OR_GREATER [Serializable] #endif public class JpegProcessingException : ImageProcessingException @@ -28,7 +28,7 @@ public JpegProcessingException(Exception? innerException) { } -#if !NETSTANDARD1_3 && !NET8_0_OR_GREATER +#if !NET8_0_OR_GREATER protected JpegProcessingException(SerializationInfo info, StreamingContext context) : base(info, context) { diff --git a/MetadataExtractor/Formats/Png/PngColorType.cs b/MetadataExtractor/Formats/Png/PngColorType.cs index d818da57a..f2add90f3 100644 --- a/MetadataExtractor/Formats/Png/PngColorType.cs +++ b/MetadataExtractor/Formats/Png/PngColorType.cs @@ -3,7 +3,7 @@ namespace MetadataExtractor.Formats.Png { /// Drew Noakes https://drewnoakes.com -#if !NETSTANDARD1_3 && !NET8_0_OR_GREATER +#if !NET8_0_OR_GREATER [Serializable] #endif public sealed class PngColorType diff --git a/MetadataExtractor/Formats/Png/PngProcessingException.cs b/MetadataExtractor/Formats/Png/PngProcessingException.cs index 1b6df8b42..34f121d46 100644 --- a/MetadataExtractor/Formats/Png/PngProcessingException.cs +++ b/MetadataExtractor/Formats/Png/PngProcessingException.cs @@ -1,6 +1,6 @@ // Copyright (c) Drew Noakes and contributors. All Rights Reserved. Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -#if !NETSTANDARD1_3 && !NET8_0_OR_GREATER +#if !NET8_0_OR_GREATER using System.Runtime.Serialization; #endif @@ -8,7 +8,7 @@ namespace MetadataExtractor.Formats.Png { /// An exception class thrown upon unexpected and fatal conditions while processing a JPEG file. /// Drew Noakes https://drewnoakes.com -#if !NETSTANDARD1_3 && !NET8_0_OR_GREATER +#if !NET8_0_OR_GREATER [Serializable] #endif public class PngProcessingException : ImageProcessingException @@ -28,7 +28,7 @@ public PngProcessingException(Exception? innerException) { } -#if !NETSTANDARD1_3 && !NET8_0_OR_GREATER +#if !NET8_0_OR_GREATER protected PngProcessingException(SerializationInfo info, StreamingContext context) : base(info, context) { diff --git a/MetadataExtractor/Formats/QuickTime/QuickTimeReaderExtensions.cs b/MetadataExtractor/Formats/QuickTime/QuickTimeReaderExtensions.cs index eae7777b8..57bd00c02 100644 --- a/MetadataExtractor/Formats/QuickTime/QuickTimeReaderExtensions.cs +++ b/MetadataExtractor/Formats/QuickTime/QuickTimeReaderExtensions.cs @@ -7,11 +7,7 @@ namespace MetadataExtractor.Formats.QuickTime /// public static class QuickTimeReaderExtensions { -#if NET462 || NETSTANDARD1_3 - public static unsafe string Get4ccString(this SequentialReader reader) -#else public static string Get4ccString(this SequentialReader reader) -#endif { // https://en.wikipedia.org/wiki/FourCC @@ -28,14 +24,7 @@ public static string Get4ccString(this SequentialReader reader) (char)bytes[3] ]; -#if NET462 || NETSTANDARD1_3 - fixed (char* pChars = chars) - { - return new string(pChars, startIndex: 0, length: 4); - } -#else - return new string(chars); -#endif + return chars.ToString(); } public static decimal Get16BitFixedPoint(this SequentialReader reader) diff --git a/MetadataExtractor/Formats/Riff/RiffProcessingException.cs b/MetadataExtractor/Formats/Riff/RiffProcessingException.cs index aa8ecf550..c3ee00788 100644 --- a/MetadataExtractor/Formats/Riff/RiffProcessingException.cs +++ b/MetadataExtractor/Formats/Riff/RiffProcessingException.cs @@ -1,6 +1,6 @@ // Copyright (c) Drew Noakes and contributors. All Rights Reserved. Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -#if !NETSTANDARD1_3 && !NET8_0_OR_GREATER +#if !NET8_0_OR_GREATER using System.Runtime.Serialization; #endif @@ -8,7 +8,7 @@ namespace MetadataExtractor.Formats.Riff { /// An exception class thrown upon unexpected and fatal conditions while processing a RIFF file. /// Drew Noakes https://drewnoakes.com -#if !NETSTANDARD1_3 && !NET8_0_OR_GREATER +#if !NET8_0_OR_GREATER [Serializable] #endif public class RiffProcessingException : ImageProcessingException @@ -28,7 +28,7 @@ public RiffProcessingException(Exception? innerException) { } -#if !NETSTANDARD1_3 && !NET8_0_OR_GREATER +#if !NET8_0_OR_GREATER protected RiffProcessingException(SerializationInfo info, StreamingContext context) : base(info, context) { diff --git a/MetadataExtractor/Formats/Tiff/TiffProcessingException.cs b/MetadataExtractor/Formats/Tiff/TiffProcessingException.cs index 75d1e2ab1..210635488 100644 --- a/MetadataExtractor/Formats/Tiff/TiffProcessingException.cs +++ b/MetadataExtractor/Formats/Tiff/TiffProcessingException.cs @@ -1,6 +1,6 @@ // Copyright (c) Drew Noakes and contributors. All Rights Reserved. Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -#if !NETSTANDARD1_3 && !NET8_0_OR_GREATER +#if !NET8_0_OR_GREATER using System.Runtime.Serialization; #endif @@ -9,7 +9,7 @@ namespace MetadataExtractor.Formats.Tiff /// An exception class thrown upon unexpected and fatal conditions while processing a TIFF file. /// Drew Noakes https://drewnoakes.com /// Darren Salomons -#if !NETSTANDARD1_3 && !NET8_0_OR_GREATER +#if !NET8_0_OR_GREATER [Serializable] #endif public class TiffProcessingException : ImageProcessingException @@ -29,7 +29,7 @@ public TiffProcessingException(Exception? innerException) { } -#if !NETSTANDARD1_3 && !NET8_0_OR_GREATER +#if !NET8_0_OR_GREATER protected TiffProcessingException(SerializationInfo info, StreamingContext context) : base(info, context) { diff --git a/MetadataExtractor/IO/BufferBoundsException.cs b/MetadataExtractor/IO/BufferBoundsException.cs index 9c2674b67..ba81b6639 100644 --- a/MetadataExtractor/IO/BufferBoundsException.cs +++ b/MetadataExtractor/IO/BufferBoundsException.cs @@ -1,6 +1,6 @@ // Copyright (c) Drew Noakes and contributors. All Rights Reserved. Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -#if !NETSTANDARD1_3 && !NET8_0_OR_GREATER +#if !NET8_0_OR_GREATER using System.Runtime.Serialization; #endif @@ -10,7 +10,7 @@ namespace MetadataExtractor.IO /// Thrown when the index provided to an is invalid. /// /// Drew Noakes https://drewnoakes.com -#if !NETSTANDARD1_3 && !NET8_0_OR_GREATER +#if !NET8_0_OR_GREATER [Serializable] #endif public class BufferBoundsException : IOException @@ -43,7 +43,7 @@ private static string GetMessage(int index, int bytesRequested, long bufferLengt return $"Attempt to read from beyond end of underlying data source (requested index: {index}, requested count: {bytesRequested}, max index: {bufferLength - 1})"; } -#if !NETSTANDARD1_3 && !NET8_0_OR_GREATER +#if !NET8_0_OR_GREATER protected BufferBoundsException(SerializationInfo info, StreamingContext context) : base(info, context) { diff --git a/MetadataExtractor/IO/BufferReader.Indexed.cs b/MetadataExtractor/IO/BufferReader.Indexed.cs index 0eb25066c..38d1e1745 100644 --- a/MetadataExtractor/IO/BufferReader.Indexed.cs +++ b/MetadataExtractor/IO/BufferReader.Indexed.cs @@ -129,7 +129,7 @@ public readonly long GetInt64(int index) /// public readonly float GetFloat32(int index) { -#if NET462 || NETSTANDARD1_3 +#if NETSTANDARD2_0 return BitConverter.ToSingle(BitConverter.GetBytes(GetInt32(index)), 0); #else Span bytes = stackalloc byte[4]; @@ -153,7 +153,7 @@ public readonly float GetFloat32(int index) public readonly double GetDouble64(int index) { -#if NET462 || NETSTANDARD1_3 +#if NETSTANDARD2_0 return BitConverter.Int64BitsToDouble(GetInt64(index)); #else Span bytes = stackalloc byte[8]; diff --git a/MetadataExtractor/IO/IndexedCapturingReader.cs b/MetadataExtractor/IO/IndexedCapturingReader.cs index 6a4a1ee6d..327cdaeda 100644 --- a/MetadataExtractor/IO/IndexedCapturingReader.cs +++ b/MetadataExtractor/IO/IndexedCapturingReader.cs @@ -143,7 +143,7 @@ public void Dispose() private void GetPosition(int index, out int chunkIndex, out int innerIndex) { -#if NET462 || NETSTANDARD2_1 +#if NETSTANDARD2_1 chunkIndex = Math.DivRem(index, _chunkLength, out innerIndex); #elif NET6_0_OR_GREATER (chunkIndex, innerIndex) = Math.DivRem(index, _chunkLength); diff --git a/MetadataExtractor/IO/IndexedReader.cs b/MetadataExtractor/IO/IndexedReader.cs index 2d4a06502..0cab14369 100644 --- a/MetadataExtractor/IO/IndexedReader.cs +++ b/MetadataExtractor/IO/IndexedReader.cs @@ -280,7 +280,7 @@ public float GetS15Fixed16(int index) /// public float GetFloat32(int index) { -#if NET462 || NETSTANDARD1_3 +#if NETSTANDARD2_0 return BitConverter.ToSingle(BitConverter.GetBytes(GetInt32(index)), 0); #else Span bytes = stackalloc byte[4]; @@ -299,7 +299,7 @@ public float GetFloat32(int index) /// public double GetDouble64(int index) { -#if NET462 || NETSTANDARD1_3 +#if NETSTANDARD2_0 return BitConverter.Int64BitsToDouble(GetInt64(index)); #else Span bytes = stackalloc byte[8]; diff --git a/MetadataExtractor/ImageProcessingException.cs b/MetadataExtractor/ImageProcessingException.cs index 5c9d05e3a..da288b50d 100644 --- a/MetadataExtractor/ImageProcessingException.cs +++ b/MetadataExtractor/ImageProcessingException.cs @@ -1,6 +1,6 @@ // Copyright (c) Drew Noakes and contributors. All Rights Reserved. Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -#if !NETSTANDARD1_3 && !NET8_0_OR_GREATER +#if !NET8_0_OR_GREATER using System.Runtime.Serialization; #endif @@ -8,7 +8,7 @@ namespace MetadataExtractor { /// An exception class thrown upon an unexpected condition that was fatal for the processing of an image. /// Drew Noakes https://drewnoakes.com -#if !NETSTANDARD1_3 && !NET8_0_OR_GREATER +#if !NET8_0_OR_GREATER [Serializable] #endif public class ImageProcessingException : Exception @@ -28,7 +28,7 @@ public ImageProcessingException(Exception? innerException) { } -#if !NETSTANDARD1_3 && !NET8_0_OR_GREATER +#if !NET8_0_OR_GREATER protected ImageProcessingException(SerializationInfo info, StreamingContext context) : base(info, context) { diff --git a/MetadataExtractor/MetadataException.cs b/MetadataExtractor/MetadataException.cs index 7d9691c09..6c8adce61 100644 --- a/MetadataExtractor/MetadataException.cs +++ b/MetadataExtractor/MetadataException.cs @@ -1,6 +1,6 @@ // Copyright (c) Drew Noakes and contributors. All Rights Reserved. Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -#if !NETSTANDARD1_3 && !NET8_0_OR_GREATER +#if !NET8_0_OR_GREATER using System.Runtime.Serialization; #endif @@ -8,7 +8,7 @@ namespace MetadataExtractor { /// Base class for all metadata specific exceptions. /// Drew Noakes https://drewnoakes.com -#if !NETSTANDARD1_3 && !NET8_0_OR_GREATER +#if !NET8_0_OR_GREATER [Serializable] #endif public class MetadataException : Exception @@ -28,7 +28,7 @@ public MetadataException(string? msg, Exception? innerException) { } -#if !NETSTANDARD1_3 && !NET8_0_OR_GREATER +#if !NET8_0_OR_GREATER protected MetadataException(SerializationInfo info, StreamingContext context) : base(info, context) { diff --git a/MetadataExtractor/MetadataExtractor.csproj b/MetadataExtractor/MetadataExtractor.csproj index b99c8c17c..7b89365b5 100644 --- a/MetadataExtractor/MetadataExtractor.csproj +++ b/MetadataExtractor/MetadataExtractor.csproj @@ -8,7 +8,7 @@ MOV and related QuickTime video formats such as MP4, M4V, 3G2, 3GP are supported Camera manufacturer specific support exists for Agfa, Canon, Casio, DJI, Epson, Fujifilm, Kodak, Kyocera, Leica, Minolta, Nikon, Olympus, Panasonic, Pentax, Reconyx, Sanyo, Sigma/Foveon and Sony models. Metadata Extractor - net8.0;netstandard1.3;netstandard2.1;net462 + $(ModernDotNetTargetFrameworkAlias);netstandard2.0;netstandard2.1 $(NoWarn);1591 true Metadata;Exif;IPTC;XMP;ICC;Photoshop;WebP;PNG;BMP;ICO;PCX;JPEG;TIFF;PSD;Photography;QuickTime;MOV;MP4;M4V;Video;MP3;WAV;Imaging;Video;Audio @@ -17,12 +17,12 @@ Camera manufacturer specific support exists for Agfa, Canon, Casio, DJI, Epson, true README.md - true + true true - + true true @@ -44,23 +44,18 @@ Camera manufacturer specific support exists for Agfa, Canon, Casio, DJI, Epson, - - - + + + - - - - - - - + + - + diff --git a/MetadataExtractor/PublicAPI/netstandard1.3/PublicAPI.Shipped.txt b/MetadataExtractor/PublicAPI/netstandard2.0/PublicAPI.Shipped.txt similarity index 100% rename from MetadataExtractor/PublicAPI/netstandard1.3/PublicAPI.Shipped.txt rename to MetadataExtractor/PublicAPI/netstandard2.0/PublicAPI.Shipped.txt diff --git a/MetadataExtractor/PublicAPI/netstandard1.3/PublicAPI.Unshipped.txt b/MetadataExtractor/PublicAPI/netstandard2.0/PublicAPI.Unshipped.txt similarity index 92% rename from MetadataExtractor/PublicAPI/netstandard1.3/PublicAPI.Unshipped.txt rename to MetadataExtractor/PublicAPI/netstandard2.0/PublicAPI.Unshipped.txt index 544b5c6c0..e62ac80e8 100644 --- a/MetadataExtractor/PublicAPI/netstandard1.3/PublicAPI.Unshipped.txt +++ b/MetadataExtractor/PublicAPI/netstandard2.0/PublicAPI.Unshipped.txt @@ -102,6 +102,7 @@ MetadataExtractor.Formats.Exif.Makernotes.NikonPictureControl2Descriptor.GetToni MetadataExtractor.Formats.Exif.Makernotes.NikonPictureControl2Descriptor.NikonPictureControl2Descriptor(MetadataExtractor.Formats.Exif.Makernotes.NikonPictureControl2Directory! directory) -> void MetadataExtractor.Formats.Exif.Makernotes.NikonPictureControl2Directory MetadataExtractor.Formats.Exif.Makernotes.NikonPictureControl2Directory.NikonPictureControl2Directory() -> void +MetadataExtractor.Formats.Jpeg.JpegProcessingException.JpegProcessingException(System.Runtime.Serialization.SerializationInfo! info, System.Runtime.Serialization.StreamingContext context) -> void MetadataExtractor.Formats.Png.PngChunk.ChunkType.get -> MetadataExtractor.Formats.Png.PngChunkType MetadataExtractor.Formats.Png.PngChunk.PngChunk(MetadataExtractor.Formats.Png.PngChunkType chunkType, byte[]! bytes) -> void MetadataExtractor.Formats.Png.PngChunkReader.Extract(MetadataExtractor.IO.SequentialReader! reader, System.Collections.Generic.ICollection? desiredChunkTypes) -> System.Collections.Generic.IEnumerable! @@ -109,11 +110,17 @@ MetadataExtractor.Formats.Png.PngChunkType.Equals(MetadataExtractor.Formats.Png. MetadataExtractor.Formats.Png.PngChunkType.PngChunkType() -> void MetadataExtractor.Formats.Png.PngDirectory.GetPngChunkType() -> MetadataExtractor.Formats.Png.PngChunkType MetadataExtractor.Formats.Png.PngDirectory.PngDirectory(MetadataExtractor.Formats.Png.PngChunkType pngChunkType) -> void +MetadataExtractor.Formats.Png.PngProcessingException.PngProcessingException(System.Runtime.Serialization.SerializationInfo! info, System.Runtime.Serialization.StreamingContext context) -> void +MetadataExtractor.Formats.Riff.RiffProcessingException.RiffProcessingException(System.Runtime.Serialization.SerializationInfo! info, System.Runtime.Serialization.StreamingContext context) -> void +MetadataExtractor.Formats.Tiff.TiffProcessingException.TiffProcessingException(System.Runtime.Serialization.SerializationInfo! info, System.Runtime.Serialization.StreamingContext context) -> void MetadataExtractor.GeoLocation.Equals(MetadataExtractor.GeoLocation other) -> bool MetadataExtractor.GeoLocation.GeoLocation() -> void +MetadataExtractor.ImageProcessingException.ImageProcessingException(System.Runtime.Serialization.SerializationInfo! info, System.Runtime.Serialization.StreamingContext context) -> void +MetadataExtractor.IO.BufferBoundsException.BufferBoundsException(System.Runtime.Serialization.SerializationInfo! info, System.Runtime.Serialization.StreamingContext context) -> void MetadataExtractor.IO.IndexedCapturingReader.Dispose() -> void MetadataExtractor.IO.IndexedReader.GetByte(int index) -> byte MetadataExtractor.IO.IndexedReader.GetBytes(int index, int count) -> byte[]! +MetadataExtractor.MetadataException.MetadataException(System.Runtime.Serialization.SerializationInfo! info, System.Runtime.Serialization.StreamingContext context) -> void MetadataExtractor.Util.FileType.Avif = 28 -> MetadataExtractor.Util.FileType MetadataExtractor.Util.FileType.Dng = 29 -> MetadataExtractor.Util.FileType MetadataExtractor.Util.FileType.GoPro = 30 -> MetadataExtractor.Util.FileType diff --git a/MetadataExtractor/Rational.cs b/MetadataExtractor/Rational.cs index a843e09a4..42177cfce 100644 --- a/MetadataExtractor/Rational.cs +++ b/MetadataExtractor/Rational.cs @@ -1,9 +1,7 @@ // Copyright (c) Drew Noakes and contributors. All Rights Reserved. Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -#if !NETSTANDARD1_3 using System.Globalization; using System.ComponentModel; -#endif // TODO operator overloads @@ -15,10 +13,8 @@ namespace MetadataExtractor /// Note that any with a numerator of zero will be treated as zero, even if the denominator is also zero. /// /// Drew Noakes https://drewnoakes.com -#if !NETSTANDARD1_3 [Serializable] [TypeConverter(typeof(RationalConverter))] -#endif public readonly struct Rational : IConvertible, IEquatable { /// Gets the denominator. @@ -312,7 +308,6 @@ static long GCD(long a, long b) #region RationalConverter -#if !NETSTANDARD1_3 private sealed class RationalConverter : TypeConverter { public override bool CanConvertFrom(ITypeDescriptorContext? context, Type sourceType) @@ -356,7 +351,6 @@ public override bool CanConvertFrom(ITypeDescriptorContext? context, Type source public override bool CanConvertTo(ITypeDescriptorContext? context, [NotNullWhen(true)] Type? destinationType) => false; } -#endif #endregion } diff --git a/MetadataExtractor/StringValue.cs b/MetadataExtractor/StringValue.cs index eb69aae49..409a33d90 100644 --- a/MetadataExtractor/StringValue.cs +++ b/MetadataExtractor/StringValue.cs @@ -56,7 +56,7 @@ int IConvertible.ToInt32(IFormatProvider? provider) { try { -#if NETSTANDARD1_3 || NETFRAMEWORK +#if NETSTANDARD2_0 return int.Parse(ToString()); #else if (Bytes.Length < 100) @@ -95,7 +95,7 @@ uint IConvertible.ToUInt32(IFormatProvider? provider) { try { -#if NETSTANDARD1_3 || NETFRAMEWORK +#if NETSTANDARD2_0 return uint.Parse(ToString()); #else if (Bytes.Length < 100) diff --git a/MetadataExtractor/TagDescriptor.cs b/MetadataExtractor/TagDescriptor.cs index 1bd7ac57c..05141ce0f 100644 --- a/MetadataExtractor/TagDescriptor.cs +++ b/MetadataExtractor/TagDescriptor.cs @@ -267,17 +267,9 @@ public TagDescriptor(T directory) sb.Append(GetFStopDescription(values[2].ToDouble())); else sb.Append("f/") -#if !NETSTANDARD1_3 .Append(Math.Round(values[2].ToDouble(), 1, MidpointRounding.AwayFromZero).ToString("0.0")) -#else - .Append(Math.Round(values[2].ToDouble(), 1).ToString("0.0")) -#endif .Append('-') -#if !NETSTANDARD1_3 .Append(Math.Round(values[3].ToDouble(), 1, MidpointRounding.AwayFromZero).ToString("0.0")); -#else - .Append(Math.Round(values[3].ToDouble(), 1).ToString("0.0")); -#endif } return sb.ToString(); diff --git a/MetadataExtractor/Util/EncodingExtensions.cs b/MetadataExtractor/Util/EncodingExtensions.cs index b195a74a7..f34896006 100644 --- a/MetadataExtractor/Util/EncodingExtensions.cs +++ b/MetadataExtractor/Util/EncodingExtensions.cs @@ -1,6 +1,6 @@ // Copyright (c) Drew Noakes and contributors. All Rights Reserved. Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -#if NETFRAMEWORK || NETSTANDARD1_3 +#if NETSTANDARD2_0 internal static class EncodingExtensions { diff --git a/README.md b/README.md index d2534d787..3b61ac743 100644 --- a/README.md +++ b/README.md @@ -146,23 +146,29 @@ Camera-specific "makernote" data is decoded for cameras manufactured by: This library targets: - .NET 8.0 (`net8.0`) -- .NET Framework 4.6.2 (`net462`) -- .NET Standard 1.3 (`netstandard1.3`) +- .NET Standard 2.0 (`netstandard2.0`) - .NET Standard 2.1 (`netstandard2.1`) All target frameworks are provided via the [one NuGet package](https://www.nuget.org/packages/MetadataExtractor). `net8.0` implements .NET 8, including support for NativeAOT. -`netstandard1.3` implements version 1.3 of the [.NET Standard](https://docs.microsoft.com/en-us/dotnet/articles/standard/library) which covers .NET Core, Mono, Xamarin platforms, UWP, and future platforms. +`netstandard2.0` implements version 2.0 of the [.NET Standard](https://docs.microsoft.com/en-us/dotnet/articles/standard/library) which covers .NET Framework and .NET Core. `netstandard2.1` implements version 2.1 of the .NET Standard, which uses newer APIs where possible. -`net462` targets the full .NET Framework, from version 4.6.2 onwards. +
+ Support for older targets in previous versions -A PCL build was supported until [version 1.5.3](https://www.nuget.org/packages/MetadataExtractor/1.5.3) which supported Silverlight 5.0, Windows 8.0, Windows Phone 8.1 and Windows Phone Silverlight 8.0. PCL versions did not support file-system metadata due to restricted IO APIs. +- A PCL build was supported until [version 1.5.3](https://www.nuget.org/packages/MetadataExtractor/1.5.3) which supported Silverlight 5.0, Windows 8.0, Windows Phone 8.1 and Windows Phone Silverlight 8.0. PCL versions did not support file-system metadata due to restricted IO APIs. -A `net3.5` build was supported until [version 2.8.1](https://www.nuget.org/packages/MetadataExtractor/2.8.1). Support for this framework was dropped in early 2024 to enable use of newer, more efficient, .NET APIs. +- A `netstandard1.3` build was supported until [version 2.8.1](https://www.nuget.org/packages/MetadataExtractor/2.8.1). Support for this framework was dropped in mid 2025 in response to Microsoft advisory [NETSDK1215](https://aka.ms/dotnet/dotnet-standard-guidance) (since .NET SDK 9). + +- A `net462` build was supported until [version 2.8.1](https://www.nuget.org/packages/MetadataExtractor/2.8.1). This target became obsolete with the introduction of `netstandard2.0`. + +- A `net3.5` build was supported until [version 2.8.1](https://www.nuget.org/packages/MetadataExtractor/2.8.1). Support for this framework was dropped in early 2024 to enable use of newer, more efficient, .NET APIs. + +
## Building