This project is read-only.

getting ImageTools.IO.Png exception even if that dll isn't used (nor needed)

Apr 5, 2011 at 9:32 PM


MemoryStream ms = new MemoryStream(pd.Data.ToArray()); 		//jpeg data loaded from database
ExtendedImage eImage = new ExtendedImage();
JpegDecoder jpegDecoder = new JpegDecoder();
jpegDecoder.Decode(eImage, ms);
photoWindow.PhotoPlaceholder.Source = eImage.ToBitmap();	//exception gets thrown here

After a couple weeks working great, I started getting an exception on the last line here.  "ImageTools.ImageExtensions threw and exception."  
"TypeInitializationException...Could not load file or assembly 'ImageTools.IO.Png'...The system cannot fine the file specified at ImageTools.ImageExtenstions..cctor()..."

I'm not using ImageTools.IO.png.dll, just ImageTools.IO.Jpeg.dll.  I added ImageTools.IO.Png to the project and the exception went away.  Since I'm not doing any png work, I shouldn't
need it, right?  I'd prefer to take it out.  Any idea why this might start happening (seemingly out of the blue)?

Thanks for an extremely useful project though!!!



Apr 6, 2011 at 10:09 PM
Hi greg,

I use png as default image format (because you dont loose details when
encoding a image as png) and if you also use ImageTools.Utils you have
to add ImageTools.IO.Png.dll as reference.