From 84182c5aafa253f402be61816d3a1b8a3754d61c Mon Sep 17 00:00:00 2001 From: Brian Popow Date: Mon, 30 Mar 2026 17:35:25 +0200 Subject: [PATCH] Remove more unused variables --- .../Exr/Compression/Decompressors/B44ExrCompression.cs | 2 +- src/ImageSharp/Formats/Exr/ExrEncoderCore.cs | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/src/ImageSharp/Formats/Exr/Compression/Decompressors/B44ExrCompression.cs b/src/ImageSharp/Formats/Exr/Compression/Decompressors/B44ExrCompression.cs index bf6d9929e2..e5b735a395 100644 --- a/src/ImageSharp/Formats/Exr/Compression/Decompressors/B44ExrCompression.cs +++ b/src/ImageSharp/Formats/Exr/Compression/Decompressors/B44ExrCompression.cs @@ -18,7 +18,7 @@ internal class B44ExrCompression : ExrBaseDecompressor private readonly byte[] scratch = new byte[14]; - private ushort[] s = new ushort[16]; + private readonly ushort[] s = new ushort[16]; private readonly IMemoryOwner tmpBuffer; diff --git a/src/ImageSharp/Formats/Exr/ExrEncoderCore.cs b/src/ImageSharp/Formats/Exr/ExrEncoderCore.cs index be2b7e5ffe..6f11bd9f4c 100644 --- a/src/ImageSharp/Formats/Exr/ExrEncoderCore.cs +++ b/src/ImageSharp/Formats/Exr/ExrEncoderCore.cs @@ -121,7 +121,6 @@ internal sealed class ExrEncoderCore this.WriteHeader(stream, header); // Next is offsets table to each pixel row, which will be written after the pixel data was written. - int bytesPerChannel = this.pixelType == ExrPixelType.Half ? 2 : 4; ulong startOfRowOffsetData = (ulong)stream.Position; stream.Position += 8 * height; @@ -238,7 +237,6 @@ internal sealed class ExrEncoderCore uint bytesPerRow = ExrUtils.CalculateBytesPerRow(channels, (uint)width); uint rowsPerBlock = ExrUtils.RowsPerBlock(compression); uint bytesPerBlock = bytesPerRow * rowsPerBlock; - int channelCount = channels.Count; using IMemoryOwner rgbBuffer = this.memoryAllocator.Allocate(width * 3, AllocationOptions.Clean); using IMemoryOwner rowBlockBuffer = this.memoryAllocator.Allocate((int)bytesPerBlock, AllocationOptions.Clean); @@ -379,8 +377,6 @@ internal sealed class ExrEncoderCore private void WriteRowOffsets(Stream stream, int height, ulong[] rowOffsets) { - ulong startOfRowOffsetData = (ulong)stream.Position; - ulong offset = startOfRowOffsetData; for (int i = 0; i < height; i++) { BinaryPrimitives.WriteUInt64LittleEndian(this.buffer, rowOffsets[i]);