Browse Source

Update Magick.NET-Q16 to version 14.11.1 for fix to decoding zip compressed exr files

pull/3096/head
Brian Popow 1 month ago
parent
commit
9ead3ebe3a
  1. 2
      tests/Directory.Build.targets
  2. 2
      tests/ImageSharp.Benchmarks/Codecs/Exr/DecodeExr.cs
  3. 2
      tests/ImageSharp.Benchmarks/Codecs/Tga/DecodeTga.cs
  4. 4
      tests/ImageSharp.Benchmarks/Codecs/Webp/DecodeWebp.cs
  5. 4
      tests/ImageSharp.Benchmarks/LoadResizeSave/LoadResizeSaveStressRunner.cs
  6. 14
      tests/ImageSharp.Tests/TestUtilities/ReferenceCodecs/MagickReferenceDecoder.cs

2
tests/Directory.Build.targets

@ -24,7 +24,7 @@
Do not update to 14+ yet. There's differnce in how the BMP decoder handles rounding in 16 bit images.
See https://github.com/ImageMagick/ImageMagick/commit/27a0a9c37f18af9c8d823a3ea076f600843b553c
-->
<PackageReference Update="Magick.NET-Q16-AnyCPU" Version="13.10.0" />
<PackageReference Update="Magick.NET-Q16-AnyCPU" Version="14.11.1" />
<PackageReference Update="Microsoft.DotNet.RemoteExecutor" Version="10.0.0-beta.25563.105" />
<PackageReference Update="Microsoft.DotNet.XUnitExtensions" Version="8.0.0-beta.23580.1" />
<PackageReference Update="Moq" Version="4.20.72" />

2
tests/ImageSharp.Benchmarks/Codecs/Exr/DecodeExr.cs

@ -34,7 +34,7 @@ public class DecodeExr
}
[Benchmark(Description = "Magick Exr")]
public int ExrImageMagick()
public uint ExrImageMagick()
{
MagickReadSettings settings = new() { Format = MagickFormat.Exr };
using MemoryStream memoryStream = new(this.imageBytes);

2
tests/ImageSharp.Benchmarks/Codecs/Tga/DecodeTga.cs

@ -27,7 +27,7 @@ public class DecodeTga
=> this.data = File.ReadAllBytes(this.TestImageFullPath);
[Benchmark(Baseline = true, Description = "ImageMagick Tga")]
public int TgaImageMagick()
public uint TgaImageMagick()
{
MagickReadSettings settings = new() { Format = MagickFormat.Tga };
using MagickImage image = new(new MemoryStream(this.data), settings);

4
tests/ImageSharp.Benchmarks/Codecs/Webp/DecodeWebp.cs

@ -42,7 +42,7 @@ public class DecodeWebp
}
[Benchmark(Description = "Magick Lossy Webp")]
public int WebpLossyMagick()
public uint WebpLossyMagick()
{
MagickReadSettings settings = new() { Format = MagickFormat.WebP };
using MemoryStream memoryStream = new(this.webpLossyBytes);
@ -59,7 +59,7 @@ public class DecodeWebp
}
[Benchmark(Description = "Magick Lossless Webp")]
public int WebpLosslessMagick()
public uint WebpLosslessMagick()
{
MagickReadSettings settings = new()
{ Format = MagickFormat.WebP };

4
tests/ImageSharp.Benchmarks/LoadResizeSave/LoadResizeSaveStressRunner.cs

@ -248,10 +248,10 @@ public class LoadResizeSaveStressRunner
public void MagickResize(string input)
{
using MagickImage image = new(input);
this.LogImageProcessed(image.Width, image.Height);
this.LogImageProcessed((int)image.Width, (int)image.Height);
// Resize it to fit a 150x150 square
image.Resize(this.ThumbnailSize, this.ThumbnailSize);
image.Resize((uint)this.ThumbnailSize, (uint)this.ThumbnailSize);
// Reduce the size of the file
image.Strip();

14
tests/ImageSharp.Tests/TestUtilities/ReferenceCodecs/MagickReferenceDecoder.cs

@ -61,14 +61,14 @@ public class MagickReferenceDecoder : ImageDecoder
MagickReadSettings settings = new()
{
FrameCount = (int)options.MaxFrames
FrameCount = options.MaxFrames
};
settings.SetDefines(bmpReadDefines);
settings.SetDefines(pngReadDefines);
using MagickImageCollection magickImageCollection = new(stream, settings);
int imageWidth = magickImageCollection.Max(x => x.Width);
int imageHeight = magickImageCollection.Max(x => x.Height);
int imageWidth = (int)magickImageCollection.Max(x => x.Width);
int imageHeight = (int)magickImageCollection.Max(x => x.Height);
List<ImageFrame<TPixel>> framesList = [];
foreach (IMagickImage<ushort> magicFrame in magickImageCollection)
@ -77,10 +77,10 @@ public class MagickReferenceDecoder : ImageDecoder
framesList.Add(frame);
Buffer2DRegion<TPixel> buffer = frame.PixelBuffer.GetRegion(
imageWidth - magicFrame.Width,
imageHeight - magicFrame.Height,
magicFrame.Width,
magicFrame.Height);
(int)(imageWidth - magicFrame.Width),
(int)(imageHeight - magicFrame.Height),
(int)magicFrame.Width,
(int)magicFrame.Height);
using IUnsafePixelCollection<ushort> pixels = magicFrame.GetPixelsUnsafe();
if (magicFrame.Depth is 12 or 10 or 8 or 6 or 5 or 4 or 3 or 2 or 1)

Loading…
Cancel
Save