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

DivideByZeroException when passing in 0 quality #8

Open
GoogleCodeExporter opened this issue Jun 8, 2015 · 0 comments
Open

DivideByZeroException when passing in 0 quality #8

GoogleCodeExporter opened this issue Jun 8, 2015 · 0 comments

Comments

@GoogleCodeExporter
Copy link

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

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

No branches or pull requests

1 participant