menghui0330 / fjcore

Automatically exported from code.google.com/p/fjcore
0 stars 0 forks source link

DivideByZeroException when passing in 0 quality #8

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
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 Daniel.L...@gmail.com on 31 Jul 2009 at 10:33