diff --git a/src/ImageSharp/Formats/Ani/AniConstants.cs b/src/ImageSharp/Formats/Ani/AniConstants.cs
index 0b40efa31..b5b282de5 100644
--- a/src/ImageSharp/Formats/Ani/AniConstants.cs
+++ b/src/ImageSharp/Formats/Ani/AniConstants.cs
@@ -5,6 +5,11 @@ namespace SixLabors.ImageSharp.Formats.Ani;
internal static class AniConstants
{
+ ///
+ /// Gets the header bytes identifying an ani.
+ ///
+ public const uint AniFourCc = 0x41_43_4F_4E;
+
///
/// The list of mime types that equate to an ani.
///
@@ -19,20 +24,4 @@ internal static class AniConstants
/// Gets the header bytes identifying an ani.
///
public static ReadOnlySpan AniFormTypeFourCc => "ACON"u8;
-
- ///
- /// Gets the header bytes identifying an ani.
- ///
- public const uint AniFourCc = 0x41_43_4F_4E;
-
- public static class ChunkFourCcs
- {
- public static ReadOnlySpan AniHeader => "anih"u8;
-
- public static ReadOnlySpan Seq => "seq "u8;
-
- public static ReadOnlySpan Rate => "rate"u8;
-
- public static ReadOnlySpan Icon => "icon"u8;
- }
}
diff --git a/src/ImageSharp/Formats/Ani/AniDecoderCore.cs b/src/ImageSharp/Formats/Ani/AniDecoderCore.cs
index d5507208b..71594b6f5 100644
--- a/src/ImageSharp/Formats/Ani/AniDecoderCore.cs
+++ b/src/ImageSharp/Formats/Ani/AniDecoderCore.cs
@@ -15,19 +15,11 @@ using SixLabors.ImageSharp.IO;
using SixLabors.ImageSharp.Memory;
using SixLabors.ImageSharp.Memory.Internals;
using SixLabors.ImageSharp.Metadata;
-using SixLabors.ImageSharp.PixelFormats;
namespace SixLabors.ImageSharp.Formats.Ani;
internal class AniDecoderCore(DecoderOptions options) : ImageDecoderCore(options)
{
- private enum ListIconChunkType : byte
- {
- Ico = 1,
- Cur = 2,
- Bmp = 3
- }
-
///
/// The general decoder options.
///
@@ -40,6 +32,13 @@ internal class AniDecoderCore(DecoderOptions options) : ImageDecoderCore(options
private AniHeader header;
+ private enum ListIconChunkType : byte
+ {
+ Ico = 1,
+ Cur,
+ Bmp
+ }
+
protected override Image Decode(BufferedReadStream stream, CancellationToken cancellationToken)
{
this.currentStream = stream;
diff --git a/src/ImageSharp/Formats/Ani/AniHeader.cs b/src/ImageSharp/Formats/Ani/AniHeader.cs
index 474aeb7a6..1656911cc 100644
--- a/src/ImageSharp/Formats/Ani/AniHeader.cs
+++ b/src/ImageSharp/Formats/Ani/AniHeader.cs
@@ -30,20 +30,3 @@ internal readonly struct AniHeader
public void WriteTo(Stream stream) => stream.Write(MemoryMarshal.AsBytes(MemoryMarshal.CreateReadOnlySpan(in this, 1)));
}
-
-///
-/// Flags for the ANI header.
-///
-[Flags]
-public enum AniHeaderFlags : uint
-{
- ///
- /// If set, the ANI file's "icon" chunk contains an ICO or CUR file, otherwise it contains a BMP file.
- ///
- IsIcon = 1,
-
- ///
- /// If set, the ANI file contains a "seq " chunk.
- ///
- ContainsSeq = 2
-}
diff --git a/src/ImageSharp/Formats/Ani/AniHeaderFlags.cs b/src/ImageSharp/Formats/Ani/AniHeaderFlags.cs
new file mode 100644
index 000000000..37a27c28b
--- /dev/null
+++ b/src/ImageSharp/Formats/Ani/AniHeaderFlags.cs
@@ -0,0 +1,21 @@
+// Copyright (c) Six Labors.
+// Licensed under the Six Labors Split License.
+
+namespace SixLabors.ImageSharp.Formats.Ani;
+
+///
+/// Flags for the ANI header.
+///
+[Flags]
+public enum AniHeaderFlags : uint
+{
+ ///
+ /// If set, the ANI file's "icon" chunk contains an ICO or CUR file, otherwise it contains a BMP file.
+ ///
+ IsIcon = 1,
+
+ ///
+ /// If set, the ANI file contains a "seq " chunk.
+ ///
+ ContainsSeq = 2
+}
diff --git a/src/ImageSharp/Formats/Ani/AniMetadata.cs b/src/ImageSharp/Formats/Ani/AniMetadata.cs
index 72d2b8327..cdebcbb24 100644
--- a/src/ImageSharp/Formats/Ani/AniMetadata.cs
+++ b/src/ImageSharp/Formats/Ani/AniMetadata.cs
@@ -11,6 +11,13 @@ namespace SixLabors.ImageSharp.Formats.Ani;
///
public class AniMetadata : IFormatMetadata
{
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ public AniMetadata()
+ {
+ }
+
///
/// Gets or sets the width of frames in the animation.
///
@@ -56,13 +63,6 @@ public class AniMetadata : IFormatMetadata
///
public IList IconFrames { get; set; } = [];
- ///
- /// Initializes a new instance of the class.
- ///
- public AniMetadata()
- {
- }
-
///
public static AniMetadata FromFormatConnectingMetadata(FormatConnectingMetadata metadata) => throw new NotImplementedException();
diff --git a/src/ImageSharp/Formats/Webp/RiffChunkHeader.cs b/src/ImageSharp/Formats/Webp/RiffChunkHeader.cs
new file mode 100644
index 000000000..3fd67e535
--- /dev/null
+++ b/src/ImageSharp/Formats/Webp/RiffChunkHeader.cs
@@ -0,0 +1,16 @@
+// Copyright (c) Six Labors.
+// Licensed under the Six Labors Split License.
+
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+namespace SixLabors.ImageSharp.Formats.Webp;
+
+internal readonly struct RiffChunkHeader
+{
+ public readonly uint FourCc;
+
+ public readonly uint Size;
+
+ public ReadOnlySpan FourCcBytes => MemoryMarshal.CreateReadOnlySpan(ref Unsafe.As(ref Unsafe.AsRef(in this.FourCc)), sizeof(uint));
+}
diff --git a/src/ImageSharp/Formats/Webp/RiffHelper.cs b/src/ImageSharp/Formats/Webp/RiffHelper.cs
index e40c398f9..1a409eb8e 100644
--- a/src/ImageSharp/Formats/Webp/RiffHelper.cs
+++ b/src/ImageSharp/Formats/Webp/RiffHelper.cs
@@ -93,31 +93,3 @@ internal static class RiffHelper
}
}
}
-
-internal readonly struct RiffChunkHeader
-{
- public readonly uint FourCc;
-
- public ReadOnlySpan FourCcBytes => MemoryMarshal.CreateReadOnlySpan(ref Unsafe.As(ref Unsafe.AsRef(in this.FourCc)), sizeof(uint));
-
- public readonly uint Size;
-}
-
-internal readonly struct RiffOrListChunkHeader
-{
- public const int HeaderSize = 12;
-
- public readonly uint FourCc;
-
- public readonly uint Size;
-
- public readonly uint FormType;
-
- public ReadOnlySpan FourCcBytes => MemoryMarshal.CreateReadOnlySpan(ref Unsafe.As(ref Unsafe.AsRef(in this.FourCc)), sizeof(uint));
-
- public bool IsRiff => this.FourCc is 0x52_49_46_46; // "RIFF"
-
- public bool IsList => this.FourCc is 0x4C_49_53_54; // "LIST"
-
- public static ref RiffOrListChunkHeader Parse(ReadOnlySpan data) => ref Unsafe.As(ref MemoryMarshal.GetReference(data));
-}
diff --git a/src/ImageSharp/Formats/Webp/RiffOrListChunkHeader.cs b/src/ImageSharp/Formats/Webp/RiffOrListChunkHeader.cs
new file mode 100644
index 000000000..4f12d8342
--- /dev/null
+++ b/src/ImageSharp/Formats/Webp/RiffOrListChunkHeader.cs
@@ -0,0 +1,26 @@
+// Copyright (c) Six Labors.
+// Licensed under the Six Labors Split License.
+
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+namespace SixLabors.ImageSharp.Formats.Webp;
+
+internal readonly struct RiffOrListChunkHeader
+{
+ public const int HeaderSize = 12;
+
+ public readonly uint FourCc;
+
+ public readonly uint Size;
+
+ public readonly uint FormType;
+
+ public ReadOnlySpan FourCcBytes => MemoryMarshal.CreateReadOnlySpan(ref Unsafe.As(ref Unsafe.AsRef(in this.FourCc)), sizeof(uint));
+
+ public bool IsRiff => this.FourCc is 0x52_49_46_46; // "RIFF"
+
+ public bool IsList => this.FourCc is 0x4C_49_53_54; // "LIST"
+
+ public static ref RiffOrListChunkHeader Parse(ReadOnlySpan data) => ref Unsafe.As(ref MemoryMarshal.GetReference(data));
+}
diff --git a/src/ImageSharp/Formats/Webp/WebpConstants.cs b/src/ImageSharp/Formats/Webp/WebpConstants.cs
index 56b989794..89092d3c7 100644
--- a/src/ImageSharp/Formats/Webp/WebpConstants.cs
+++ b/src/ImageSharp/Formats/Webp/WebpConstants.cs
@@ -28,11 +28,6 @@ internal static class WebpConstants
0x2A
};
- ///
- /// Gets the header bytes identifying a Webp.
- ///
- public static ReadOnlySpan WebpFormTypeFourCc => "WEBP"u8;
-
///
/// Gets the header bytes identifying a Webp.
///
@@ -302,4 +297,9 @@ internal static class WebpConstants
-7, 8,
-8, -9
};
+
+ ///
+ /// Gets the header bytes identifying a Webp.
+ ///
+ public static ReadOnlySpan WebpFormTypeFourCc => "WEBP"u8;
}
diff --git a/src/ImageSharp/IO/BufferedReadStream.cs b/src/ImageSharp/IO/BufferedReadStream.cs
index e1e5597de..36e0bbb55 100644
--- a/src/ImageSharp/IO/BufferedReadStream.cs
+++ b/src/ImageSharp/IO/BufferedReadStream.cs
@@ -3,12 +3,7 @@
using System.Buffers;
using System.Runtime.CompilerServices;
-using SixLabors.ImageSharp.Formats.Ani;
-using static System.Runtime.InteropServices.JavaScript.JSType;
using System.Runtime.InteropServices;
-using System;
-using System.Diagnostics.CodeAnalysis;
-using SixLabors.ImageSharp.Memory;
namespace SixLabors.ImageSharp.IO;