You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
System.ArgumentOutOfRangeException: 'Specified argument was out of the range of valid values.' #1505
Before I use SixLabors.ImageSharp Version="1.0.0-beta0007" it works fine. Now I updated to 1.0.2 I got this error.
You can use FSharp scripts (with the attached gif) to reproduce
#r "nuget:SixLabors.ImageSharp,1.0.2"openSixLabors.ImageSharpletimg= Image.Load("the path of the downloaded attch gif")
img.Save("the path to save the gif")
Exception:
System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
at System.ThrowHelper.ThrowArgumentOutOfRangeException()
at SixLabors.ImageSharp.Processing.Processors.Quantization.OctreeQuantizer`1.AddPaletteColors(Buffer2DRegion`1 pixelRegion)
at SixLabors.ImageSharp.Processing.Processors.Quantization.QuantizerUtilities.BuildPaletteAndQuantizeFrame[TPixel](IQuantizer`1 quantizer, ImageFrame`1 source, Rectangle bounds)
at SixLabors.ImageSharp.Formats.Gif.GifEncoderCore.EncodeLocal[TPixel](Image`1 image, IndexedImageFrame`1 quantized, Stream stream)
at SixLabors.ImageSharp.Formats.Gif.GifEncoderCore.Encode[TPixel](Image`1 image, Stream stream, CancellationToken cancellationToken)
at SixLabors.ImageSharp.Formats.ImageEncoderUtilities.Encode[TPixel](IImageEncoderInternals encoder, Image`1 image, Stream stream)
at SixLabors.ImageSharp.Image.Save(Stream stream, IImageEncoder encoder)
at SixLabors.ImageSharp.ImageExtensions.Save(Image source, String path, IImageEncoder encoder)
at <StartupCode$FSI_0004>.$FSI_0004.main@() in D:\Code\GitPrivate\MyFSharpScripts\Playground\ImageProcess.fsx:line 5
ImageSharp version: 1.0.2
Other ImageSharp packages and versions:
Environment (Operating system, version and so on): windows 10
Activity
antonfirsov commentedon Jan 14, 2021
I confirm this repros with current master.
Use this.maxColors when getting size of the reduced palette, fixes #1505
Add test case for #1505
Merge pull request #1506 from SixLabors/bp/Issue1505
Use this.maxColors when getting size of the reduced palette, fixes #1505
Add test case for #1505
Merge pull request #1506 from SixLabors/bp/Issue1505