I used to use Magick.NET 7.0.0.104 to convert PDF to PNG. This version didn't cause any errors.
Now I updated to 7.0.1.500 . Running the application on Win Server 2012 R2 works fine. But running it on Win Server 2003 ends up in an ObjectDisposedException. Testing some versions of Magick.NET shows that this issue appears since version 7.0.1 . While testing I saw Magick.NET wrote its temporary files into the application-directory, not to %TEMP% as it used to do. Setting MagickNET.SetTempDirectory doesn't change this.
I try to simplify my code and attach it to this issue.
Thanks in advance!
Wastl
```
MagickReadSettings settings = new MagickReadSettings();
settings.ColorSpace = ColorSpace.RGB;
settings.Density = new Density(200);
MagickGeometry geometry = new MagickGeometry();
geometry.Greater = true;
geometry.Width = 600;
geometry.Height = 600;
MagickImage image = new MagickImage(srcFile, settings); // source is PDF
image.Resize(geometry);
image.Format = MagickFormat.Png; // <== Exception
image.Strip();
imgData = image.ToBase64();
image.Dispose();
```
Exception says in german:
System.ObjectDisposedException
Message: Auf das verworfene Objekt kann nicht zugegriffen werden.
Objektname: "ImageMagick.MagickImage".
Comments: Thank you very much!
Now I updated to 7.0.1.500 . Running the application on Win Server 2012 R2 works fine. But running it on Win Server 2003 ends up in an ObjectDisposedException. Testing some versions of Magick.NET shows that this issue appears since version 7.0.1 . While testing I saw Magick.NET wrote its temporary files into the application-directory, not to %TEMP% as it used to do. Setting MagickNET.SetTempDirectory doesn't change this.
I try to simplify my code and attach it to this issue.
Thanks in advance!
Wastl
```
MagickReadSettings settings = new MagickReadSettings();
settings.ColorSpace = ColorSpace.RGB;
settings.Density = new Density(200);
MagickGeometry geometry = new MagickGeometry();
geometry.Greater = true;
geometry.Width = 600;
geometry.Height = 600;
MagickImage image = new MagickImage(srcFile, settings); // source is PDF
image.Resize(geometry);
image.Format = MagickFormat.Png; // <== Exception
image.Strip();
imgData = image.ToBase64();
image.Dispose();
```
Exception says in german:
System.ObjectDisposedException
Message: Auf das verworfene Objekt kann nicht zugegriffen werden.
Objektname: "ImageMagick.MagickImage".
Comments: Thank you very much!