Page 1 of 1

Getting Divide by Zero and Access Denied errors

Posted: 2014-07-16T08:09:35-07:00
by NoDozing
We're converting PDF files to PNG files. We're getting An exception of type 'System.DivideByZeroException' occurred in Magick.NET-x86.dll but was not handled in user code if we use

Code: Select all

                    var s = new MagickReadSettings();
                    s.Density = new MagickGeometry(300, 300);

                    using (var images = new MagickImageCollection())
                    {
                        images.Read(inputPdfPath, s);
We get An unhandled exception of type 'System.AccessViolationException' occurred in Magick.NET-x86.dll if we use

Code: Select all

                    var s = new MagickReadSettings();
                    s.Density = new MagickGeometry(150, 150);

                    using (var images = new MagickImageCollection())
                    {
                        images.Read(inputPdfPath, s);
We get no errors if we use:

Code: Select all

                    var s = new MagickReadSettings();
                    s.Density = new MagickGeometry(75, 75);

                    using (var images = new MagickImageCollection())
                    {
                        images.Read(inputPdfPath, s);
I'd be happy to send the PDF file is needed. Some PDFs give no errors with the first code above.

Re: Getting Divide by Zero and Access Denied errors

Posted: 2014-07-16T08:45:15-07:00
by dlemstra
Can you contact me through Codeplex (https://www.codeplex.com/site/users/view/dlemstra) and send me link to your file? If you cannot send a link just send me a message and I will reply to it so you will get my e-mail.

What is your Ghostscript version?

Re: Getting Divide by Zero and Access Denied errors

Posted: 2014-07-16T12:47:02-07:00
by NoDozing
I loaded the latest version yesterday. I have left you a message at CodePlex.

Re: Getting Divide by Zero and Access Denied errors

Posted: 2014-07-17T06:52:38-07:00
by dlemstra
The problem is a bug in the Ghostscript library. The bug report can be found here: http://bugs.ghostscript.com/show_bug.cgi?id=695372