Browse Source

Use StartsWith

pull/3153/head
winscripter 2 days ago
parent
commit
4858ef3783
  1. 2
      src/ImageSharp/Formats/Jxl/JxlImageFormatDetector.cs

2
src/ImageSharp/Formats/Jxl/JxlImageFormatDetector.cs

@ -28,7 +28,7 @@ public sealed class JxlImageFormatDetector : IImageFormatDetector
/// <inheritdoc/>
public bool TryDetectFormat(ReadOnlySpan<byte> header, [NotNullWhen(true)] out IImageFormat? format)
{
if (header[0] == 0xFF && header[1] == 0x0A)
if (header.StartsWith([(byte)0xFF, (byte)0x0A]))
{
// Just codestream.
format = new JxlFormat();

Loading…
Cancel
Save