Browse Source

Actually resize a 30k x 30k image

af/octree-no-pixelmap
Anton Firszov 6 years ago
parent
commit
492e233d97
  1. 6
      src/ImageSharp/ImageFrame{TPixel}.cs
  2. 21
      tests/ImageSharp.Tests/Image/LargeImageIntegrationTests.cs

6
src/ImageSharp/ImageFrame{TPixel}.cs

@ -284,15 +284,15 @@ namespace SixLabors.ImageSharp
/// <param name="value">The value to initialize the bitmap with.</param>
internal void Clear(TPixel value)
{
Span<TPixel> span = this.GetPixelSpan();
MemoryGroup<TPixel> group = this.PixelBuffer.MemoryGroup;
if (value.Equals(default))
{
span.Clear();
group.Clear();
}
else
{
span.Fill(value);
group.Fill(value);
}
}
}

21
tests/ImageSharp.Tests/Image/LargeImageIntegrationTests.cs

@ -0,0 +1,21 @@
// Copyright (c) Six Labors and contributors.
// Licensed under the Apache License, Version 2.0.
using SixLabors.ImageSharp.PixelFormats;
using SixLabors.ImageSharp.Processing;
using Xunit;
namespace SixLabors.ImageSharp.Tests
{
public class LargeImageIntegrationTests
{
[Theory(Skip = "For local testing only.")]
[WithBasicTestPatternImages(width: 30000, height: 30000, PixelTypes.Rgba32)]
public void CreateAndResize(TestImageProvider<Rgba32> provider)
{
using Image<Rgba32> image = provider.GetImage();
image.Mutate(c => c.Resize(1000, 1000));
image.DebugSave(provider);
}
}
}
Loading…
Cancel
Save