Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

System.ArgumentOutOfRangeException: 'Specified argument was out of the range of valid values.' #1505

Closed
albertwoo opened this issue Jan 14, 2021 · 1 comment · Fixed by #1506

Comments

@albertwoo
Copy link

Description

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"
open SixLabors.ImageSharp
let img = 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
  • .NET Framework version: .net 5.0

Sql provider

@antonfirsov antonfirsov added this to the 1.1.0 milestone Jan 14, 2021
@antonfirsov
Copy link
Member

I confirm this repros with current master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants