1

Closed

Attempted to divide by Zero. Jpeg Encoder.

description

Hi, I'm trying to encode my canvas to a jpeg.
But i got an exception "Attempted to divide by Zero." when i call the Encode method of the jpegEncoder.
I added
ImageTools.IO.Encoders.AddEncoder<ImageTools.IO.Jpeg.JpegEncoder>();
and
ImageTools.IO.Decoders.AddDecoder<ImageTools.IO.Jpeg.JpegDecoder>();
in my App.xaml.cs in Application_Startup.
 
How can I fix this? And is there a way to pass the image to a web service without writing it to client's local disc? Thank you.
Closed Feb 24, 2011 at 7:07 AM by malignate88

comments

malignate88 wrote Jan 12, 2010 at 11:35 AM

Fixed in the latest version. Not in the release.

wrote Jan 12, 2010 at 11:36 AM

abt wrote Jan 12, 2010 at 11:57 AM

Hi, thanks for the reply. I have another question, how can I write the png file to the disk without opening the safe file dialog. I tried to pass a StreamWriter object to the encode method, but it doesn't work. Thanks.

malignate88 wrote Jan 12, 2010 at 2:30 PM

Please ask ur question in the forum.

wrote Feb 24, 2011 at 7:07 AM

Resolved with changeset 61911.

wrote Feb 21, 2013 at 11:53 PM

wrote May 16, 2013 at 11:21 AM

Swinburne wrote Mar 25, 2014 at 3:18 AM

How about using jpeg 2000 codec that is a standard image compression solution widely used for archiving, distribution and screening and has many advantages over the old JPEG Standard, including both the encoder and decoder