FluxJpeg.Core icon indicating copy to clipboard operation
FluxJpeg.Core copied to clipboard

GC-8: DivideByZeroException when passing in 0 quality

Open anders9ustafsson opened this issue 9 years ago • 0 comments

From @GoogleCodeExporter on January 20, 2016 12:59

What steps will reproduce the problem?
1. Using the .NET ImageTools library which uses fjcore
            WriteableBitmap bitmap = new WriteableBitmap(pictureElement, 
null);
            ImageTools.Image image = bitmap.ToImage();
            MemoryStream stream = new MemoryStream();
            JpegEncoder encoder = new JpegEncoder();
            encoder.Encode(image, stream); 


What is the expected output? What do you see instead?

EXPECTED: Image is encoded

ACTUAL: 
Attempted to divide by zero.

   at FluxJpeg.Core.DCT.Initialize(Int32 quality)
   at FluxJpeg.Core.DCT..ctor(Int32 quality)
   at FluxJpeg.Core.Encoder.JpegEncoder..ctor(DecodedJpeg decodedJpeg, 
Int32 quality, Stream outStream)
   at ImageTools.IO.Jpeg.JpegEncoder.Encode(Image image, Stream stream)

I used .NET Reflector to determine that they are passing in 0 for quality, 
which fjcore will change to 1.

What version of the product are you using? On what operating system?

ImageTools 0.1: 
http://imagetools.codeplex.com/Release/ProjectReleases.aspx?
ReleaseId=30309#DownloadId=75694
Not sure what version of fjcore they are using.
Win7 RC.

Please provide any additional information below.


Original issue reported on code.google.com by [email protected] on 31 Jul 2009 at 10:33

Copied from original issue: #8

anders9ustafsson avatar Jan 20 '16 13:01 anders9ustafsson