From 9ac4cd91a417fa28bbb6357e1e82f63a40cab1d9 Mon Sep 17 00:00:00 2001 From: James Jackson-South Date: Mon, 4 Dec 2023 12:33:35 +1000 Subject: [PATCH] Enable CA1859 --- .gitattributes | 3 +++ shared-infrastructure | 2 +- src/ImageSharp.ruleset | 3 --- src/ImageSharp/Formats/Jpeg/Components/Decoder/JpegFrame.cs | 4 ++-- src/ImageSharp/Formats/Tiff/Ifd/DirectoryReader.cs | 2 +- src/ImageSharp/Metadata/Profiles/Exif/ExifReader.cs | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.gitattributes b/.gitattributes index 3647a7063d..b5f742ab47 100644 --- a/.gitattributes +++ b/.gitattributes @@ -133,3 +133,6 @@ *.pnm filter=lfs diff=lfs merge=lfs -text *.wbmp filter=lfs diff=lfs merge=lfs -text *.exr filter=lfs diff=lfs merge=lfs -text +*.ico filter=lfs diff=lfs merge=lfs -text +*.cur filter=lfs diff=lfs merge=lfs -text +*.ani filter=lfs diff=lfs merge=lfs -text diff --git a/shared-infrastructure b/shared-infrastructure index 4e892950d7..1c526a97ee 160000 --- a/shared-infrastructure +++ b/shared-infrastructure @@ -1 +1 @@ -Subproject commit 4e892950d7f17e5cb64160675d6902545cc3b5c5 +Subproject commit 1c526a97eea8bcbc7c79de095676f7fb975a9fb1 diff --git a/src/ImageSharp.ruleset b/src/ImageSharp.ruleset index 8327dd7565..d7a147df03 100644 --- a/src/ImageSharp.ruleset +++ b/src/ImageSharp.ruleset @@ -1,9 +1,6 @@  - - - diff --git a/src/ImageSharp/Formats/Jpeg/Components/Decoder/JpegFrame.cs b/src/ImageSharp/Formats/Jpeg/Components/Decoder/JpegFrame.cs index c3cd95c028..f251df3bf2 100644 --- a/src/ImageSharp/Formats/Jpeg/Components/Decoder/JpegFrame.cs +++ b/src/ImageSharp/Formats/Jpeg/Components/Decoder/JpegFrame.cs @@ -133,7 +133,7 @@ public void Init(int maxSubFactorH, int maxSubFactorV) for (int i = 0; i < this.ComponentCount; i++) { - IJpegComponent component = this.Components[i]; + JpegComponent component = this.Components[i]; component.Init(maxSubFactorH, maxSubFactorV); } } @@ -143,7 +143,7 @@ public void AllocateComponents() bool fullScan = this.Progressive || !this.Interleaved; for (int i = 0; i < this.ComponentCount; i++) { - IJpegComponent component = this.Components[i]; + JpegComponent component = this.Components[i]; component.AllocateSpectral(fullScan); } } diff --git a/src/ImageSharp/Formats/Tiff/Ifd/DirectoryReader.cs b/src/ImageSharp/Formats/Tiff/Ifd/DirectoryReader.cs index 086eef0585..114fc12b23 100644 --- a/src/ImageSharp/Formats/Tiff/Ifd/DirectoryReader.cs +++ b/src/ImageSharp/Formats/Tiff/Ifd/DirectoryReader.cs @@ -71,7 +71,7 @@ private static ByteOrder ReadByteOrder(Stream stream) throw TiffThrowHelper.ThrowInvalidHeader(); } - private IList ReadIfds(bool isBigTiff) + private List ReadIfds(bool isBigTiff) { List readers = new(); while (this.nextIfdOffset != 0 && this.nextIfdOffset < (ulong)this.stream.Length) diff --git a/src/ImageSharp/Metadata/Profiles/Exif/ExifReader.cs b/src/ImageSharp/Metadata/Profiles/Exif/ExifReader.cs index 953ef74afb..a4fcd9275b 100644 --- a/src/ImageSharp/Metadata/Profiles/Exif/ExifReader.cs +++ b/src/ImageSharp/Metadata/Profiles/Exif/ExifReader.cs @@ -472,7 +472,7 @@ private void ReadValue64(List values, Span offsetBuffer) } } - private void Add(IList values, IExifValue exif, object? value) + private void Add(IList values, ExifValue exif, object? value) { if (!exif.TrySetValue(value)) {