Quantcast
Channel: magick Issue Tracker Rss Feed
Viewing all 1011 articles
Browse latest View live

Commented Unassigned: ObjectDisposedException since 7.0.1 [1398]

$
0
0
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: Sorry I forgot to mention that I'm using Magick.NET-Q16-AnyCPU, the application uses Magick.NET.net40-client.7.0.X.X/Magick.NET-Q16-x86.Native.dll

Commented Unassigned: ObjectDisposedException since 7.0.1 [1398]

$
0
0
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: I recently reinstalled my machine and I forgot to make the changes to Visual Studio 2015 that were reported here: https://magick.codeplex.com/workitem/1370 (solution in https://magick.codeplex.com/SourceControl/latest#Building.md). This will be resolved in the next version of Magick.NET.

Edited Issue: ObjectDisposedException since 7.0.1 [1398]

$
0
0
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".

Commented Unassigned: Issue when converting a PDF to PNG [1394]

$
0
0
I have noticed issues when converting large PDF (3.5MB and higher) that it freezes the system, and in the course of 5 minutes will create temp files over 10GB in size.

Let me know if you need any info
Comments: Thanks for sending me the e-mail. I replied but I am not sure if you got the answer. Please use something like DropBox/OneDrive to share your files.

Commented Issue: ObjectDisposedException since 7.0.1 [1398]

$
0
0
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!

Created Unassigned: Frequently get Memory System.AccessViolationException error in NativeMethods.x64.MagickImageCollection_ReadFile [1399]

$
0
0
We are inspecting a large number of PDFs and frequently run into the following error memory corrupt errors on multiple machines. The errors are more frequent when the memory utilization is high OR there are multiple threads running.

Unhandled Exception: System.AccessViolationException: Attempted to read or write
protected memory. This is often an indication that other memory is corrupt.
at ImageMagick.MagickImageCollection.NativeMethods.X64.MagickImageCollection_
ReadFile(IntPtr settings, IntPtr& exception)
at ImageMagick.MagickImageCollection.NativeMagickImageCollection.ReadFile(Mag
ickSettings settings)
at ImageMagick.MagickImageCollection.AddImages(String fileName, MagickReadSet
tings readSettings, Boolean ping)

Please advise as we are seriously considering replacing this component as it has been persistent across versions.
Current File version that produced this error is 7.0.1.101



Commented Unassigned: Frequently get Memory System.AccessViolationException error in NativeMethods.x64.MagickImageCollection_ReadFile [1399]

$
0
0
We are inspecting a large number of PDFs and frequently run into the following error memory corrupt errors on multiple machines. The errors are more frequent when the memory utilization is high OR there are multiple threads running.

Unhandled Exception: System.AccessViolationException: Attempted to read or write
protected memory. This is often an indication that other memory is corrupt.
at ImageMagick.MagickImageCollection.NativeMethods.X64.MagickImageCollection_
ReadFile(IntPtr settings, IntPtr& exception)
at ImageMagick.MagickImageCollection.NativeMagickImageCollection.ReadFile(Mag
ickSettings settings)
at ImageMagick.MagickImageCollection.AddImages(String fileName, MagickReadSet
tings readSettings, Boolean ping)

Please advise as we are seriously considering replacing this component as it has been persistent across versions.
Current File version that produced this error is 7.0.1.101



Comments: Can you upgrade to the most recent version and see if you can reproduce it again? There was a bug in the previous version that could cause this kind of behavior.

Created Unassigned: MagickImage gets completely black after changing some pixel. [1400]

$
0
0
Hello,
I am trying to create different versions of an image, each one with a particular set of pixels blackened out. In the following code I have my lightSourceNumber set to 2, and I want to obtain 2^2 images: the original one, one that has pixels of set 1 blackned out, one that has pixels of set 2 blackned out and one that has all pixels of those 2 sets blackned out. These sets are subsets of the complete set of pixels and their cardinality is relatively low with respect to the superset's.

I begin with this:
```
MagickImage[] result = new MagickImage[numberOfEnvMaps];
for(int i = 0; i < result.Length; i++)
{
result[i] = new MagickImage(original);
}
```
for initialization, then I compute the sets I want and store them in a array with components (x,y,L), each component is in [0,1] range.

To black out pixels I use this for loop (note: I am using Accord.MachineLearning library for k-means):
```
KMeansClusterCollection lightClusters = kmeansEuclidean.Clusters;
for (int i = 0; i < result.Length; i++)
{
Console.WriteLine("Image" + i+".");
for (int j = 0; j < lightSourceNumber; j++)
{
int num = i & (int)Math.Pow(2, j);
if (num > 0) //if j-th bit is set to 1 i black-out pixels of that set
{
Console.WriteLine("Delete pixels set " + j + " from Image " + i+".");
ObscurePixels(ref result[i], ref brightestPixelsSet, lightClusters, j);

}
}

result[i].Write(@"../../OccludedImages/EnvMap_" + i + ".jpg");
```
And ObscurePixels is:
```
protected void ObscurePixels(ref MagickImage image, ref double[][] pixelSet, KMeansClusterCollection clusters, int index)
{
float[] black = { 0f, 0f, 0f }; //image has 3 channels
PixelCollection pixelsOfTheImage = image.GetPixels();
int count = 0;
foreach(double[] pixel in pixelSet)
{
if (clusters.Nearest(pixel) == index)
{
count++;
int x = (int)Math.Round(pixel[X_COMP] * image.Width);
int y = (int)Math.Round(pixel[Y_COMP] * image.Height);
pixelsOfTheImage.Set(x,y,black);
}
}
Console.WriteLine("Blackned " + count + " pixels of "+image.Width*image.Height + " belonging to pixels' set " + index + ".");

}
```
I get correct results for the first and the last image (the one without modifications and the one with pixels of all subsets, which are not all the pixels of the image, blackned out), while I get completely black images for those one I try to change only pixels from one subset. What freaks me the most is that if there was a bug in my code, shouldn't it happen for the last image aswell?

Edited Unassigned: MagickImage gets completely black after changing some pixel. [1400]

$
0
0
Hello,
I am trying to create different versions of an image, each one with a particular set of pixels blackened out. In the following code I have my lightSourceNumber set to 2, and I want to obtain 2^2 images: the original one, one that has pixels of set 1 blackned out, one that has pixels of set 2 blackned out and one that has all pixels of those 2 sets blackned out. These sets are subsets of the complete set of pixels and their cardinality is relatively low with respect to the superset's.

I begin with this:
```
MagickImage[] result = new MagickImage[numberOfEnvMaps];
for(int i = 0; i < result.Length; i++)
{
result[i] = new MagickImage(original);
}
```
for initialization, then I compute the sets I want and store them in a array with components (x,y,L), each component is in [0,1] range.

To black out pixels I use this for loop (note: I am using Accord.MachineLearning library for k-means):
```
KMeansClusterCollection lightClusters = kmeansEuclidean.Clusters;
for (int i = 0; i < result.Length; i++)
{
Console.WriteLine("Image" + i+".");
for (int j = 0; j < lightSourceNumber; j++)
{
int num = i & (int)Math.Pow(2, j);
if (num > 0) //if j-th bit is set to 1 i black-out pixels of that set
{
Console.WriteLine("Delete pixels set " + j + " from Image " + i+".");
ObscurePixels(ref result[i], ref brightestPixelsSet, lightClusters, j);

}
}

result[i].Write(@"../../OccludedImages/EnvMap_" + i + ".jpg");
}
```
And ObscurePixels is:
```
protected void ObscurePixels(ref MagickImage image, ref double[][] pixelSet, KMeansClusterCollection clusters, int index)
{
float[] black = { 0f, 0f, 0f }; //image has 3 channels
PixelCollection pixelsOfTheImage = image.GetPixels();
int count = 0;
foreach(double[] pixel in pixelSet)
{
if (clusters.Nearest(pixel) == index)
{
count++;
int x = (int)Math.Round(pixel[X_COMP] * image.Width);
int y = (int)Math.Round(pixel[Y_COMP] * image.Height);
pixelsOfTheImage.Set(x,y,black);
}
}
Console.WriteLine("Blackned " + count + " pixels of "+image.Width*image.Height + " belonging to pixels' set " + index + ".");

}
```
I get correct results for the first and the last image (the one without modifications and the one with pixels of all subsets, which are not all the pixels of the image, blackned out), while I get completely black images for those one I try to change only pixels from one subset. What freaks me the most is that if there was a bug in my code, shouldn't it happen for the last image aswell?

Commented Unassigned: MagickImage gets completely black after changing some pixel. [1400]

$
0
0
Hello,
I am trying to create different versions of an image, each one with a particular set of pixels blackened out. In the following code I have my lightSourceNumber set to 2, and I want to obtain 2^2 images: the original one, one that has pixels of set 1 blackned out, one that has pixels of set 2 blackned out and one that has all pixels of those 2 sets blackned out. These sets are subsets of the complete set of pixels and their cardinality is relatively low with respect to the superset's.

I begin with this:
```
MagickImage[] result = new MagickImage[numberOfEnvMaps];
for(int i = 0; i < result.Length; i++)
{
result[i] = new MagickImage(original);
}
```
for initialization, then I compute the sets I want and store them in a array with components (x,y,L), each component is in [0,1] range.

To black out pixels I use this for loop (note: I am using Accord.MachineLearning library for k-means):
```
KMeansClusterCollection lightClusters = kmeansEuclidean.Clusters;
for (int i = 0; i < result.Length; i++)
{
Console.WriteLine("Image" + i+".");
for (int j = 0; j < lightSourceNumber; j++)
{
int num = i & (int)Math.Pow(2, j);
if (num > 0) //if j-th bit is set to 1 i black-out pixels of that set
{
Console.WriteLine("Delete pixels set " + j + " from Image " + i+".");
ObscurePixels(ref result[i], ref brightestPixelsSet, lightClusters, j);

}
}

result[i].Write(@"../../OccludedImages/EnvMap_" + i + ".jpg");
}
```
And ObscurePixels is:
```
protected void ObscurePixels(ref MagickImage image, ref double[][] pixelSet, KMeansClusterCollection clusters, int index)
{
float[] black = { 0f, 0f, 0f }; //image has 3 channels
PixelCollection pixelsOfTheImage = image.GetPixels();
int count = 0;
foreach(double[] pixel in pixelSet)
{
if (clusters.Nearest(pixel) == index)
{
count++;
int x = (int)Math.Round(pixel[X_COMP] * image.Width);
int y = (int)Math.Round(pixel[Y_COMP] * image.Height);
pixelsOfTheImage.Set(x,y,black);
}
}
Console.WriteLine("Blackned " + count + " pixels of "+image.Width*image.Height + " belonging to pixels' set " + index + ".");

}
```
I get correct results for the first and the last image (the one without modifications and the one with pixels of all subsets, which are not all the pixels of the image, blackned out), while I get completely black images for those one I try to change only pixels from one subset. What freaks me the most is that if there was a bug in my code, shouldn't it happen for the last image aswell?
Comments: You are passing in the value j as index for the ObscurePixels and I have no clue what clusters.Nearest does so it is possible that it fails on the last image. And are you sure that your input image only has 3 channels? I cannot really advise you without more information. Would it be possible to strip down your code to the basics? And then attach it to this issue if you still think this is an Magick.NET bug.

Commented Unassigned: Frequently get Memory System.AccessViolationException error in NativeMethods.x64.MagickImageCollection_ReadFile [1399]

$
0
0
We are inspecting a large number of PDFs and frequently run into the following error memory corrupt errors on multiple machines. The errors are more frequent when the memory utilization is high OR there are multiple threads running.

Unhandled Exception: System.AccessViolationException: Attempted to read or write
protected memory. This is often an indication that other memory is corrupt.
at ImageMagick.MagickImageCollection.NativeMethods.X64.MagickImageCollection_
ReadFile(IntPtr settings, IntPtr& exception)
at ImageMagick.MagickImageCollection.NativeMagickImageCollection.ReadFile(Mag
ickSettings settings)
at ImageMagick.MagickImageCollection.AddImages(String fileName, MagickReadSet
tings readSettings, Boolean ping)

Please advise as we are seriously considering replacing this component as it has been persistent across versions.
Current File version that produced this error is 7.0.1.101



Comments: That didn't work. Upgraded to 7.0.1.500 File & Product versions of both the .Net wrapper and Native dlls is 7.0.1.500 System.AccessViolationException was unhandled Message: An unhandled exception of type 'System.AccessViolationException' occurred in Magick.NET-Q16-x64.dll Additional information: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.

Commented Unassigned: Frequently get Memory System.AccessViolationException error in NativeMethods.x64.MagickImageCollection_ReadFile [1399]

$
0
0
We are inspecting a large number of PDFs and frequently run into the following error memory corrupt errors on multiple machines. The errors are more frequent when the memory utilization is high OR there are multiple threads running.

Unhandled Exception: System.AccessViolationException: Attempted to read or write
protected memory. This is often an indication that other memory is corrupt.
at ImageMagick.MagickImageCollection.NativeMethods.X64.MagickImageCollection_
ReadFile(IntPtr settings, IntPtr& exception)
at ImageMagick.MagickImageCollection.NativeMagickImageCollection.ReadFile(Mag
ickSettings settings)
at ImageMagick.MagickImageCollection.AddImages(String fileName, MagickReadSet
tings readSettings, Boolean ping)

Please advise as we are seriously considering replacing this component as it has been persistent across versions.
Current File version that produced this error is 7.0.1.101



Comments: Would it be possible to create a program that I can use to reproduce the problem? And are you using the latest version of Ghostscript? It might be possible that this error is occurring inside the Ghostscript library.

Commented Unassigned: MagickImage gets completely black after changing some pixel. [1400]

$
0
0
Hello,
I am trying to create different versions of an image, each one with a particular set of pixels blackened out. In the following code I have my lightSourceNumber set to 2, and I want to obtain 2^2 images: the original one, one that has pixels of set 1 blackned out, one that has pixels of set 2 blackned out and one that has all pixels of those 2 sets blackned out. These sets are subsets of the complete set of pixels and their cardinality is relatively low with respect to the superset's.

I begin with this:
```
MagickImage[] result = new MagickImage[numberOfEnvMaps];
for(int i = 0; i < result.Length; i++)
{
result[i] = new MagickImage(original);
}
```
for initialization, then I compute the sets I want and store them in a array with components (x,y,L), each component is in [0,1] range.

To black out pixels I use this for loop (note: I am using Accord.MachineLearning library for k-means):
```
KMeansClusterCollection lightClusters = kmeansEuclidean.Clusters;
for (int i = 0; i < result.Length; i++)
{
Console.WriteLine("Image" + i+".");
for (int j = 0; j < lightSourceNumber; j++)
{
int num = i & (int)Math.Pow(2, j);
if (num > 0) //if j-th bit is set to 1 i black-out pixels of that set
{
Console.WriteLine("Delete pixels set " + j + " from Image " + i+".");
ObscurePixels(ref result[i], ref brightestPixelsSet, lightClusters, j);

}
}

result[i].Write(@"../../OccludedImages/EnvMap_" + i + ".jpg");
}
```
And ObscurePixels is:
```
protected void ObscurePixels(ref MagickImage image, ref double[][] pixelSet, KMeansClusterCollection clusters, int index)
{
float[] black = { 0f, 0f, 0f }; //image has 3 channels
PixelCollection pixelsOfTheImage = image.GetPixels();
int count = 0;
foreach(double[] pixel in pixelSet)
{
if (clusters.Nearest(pixel) == index)
{
count++;
int x = (int)Math.Round(pixel[X_COMP] * image.Width);
int y = (int)Math.Round(pixel[Y_COMP] * image.Height);
pixelsOfTheImage.Set(x,y,black);
}
}
Console.WriteLine("Blackned " + count + " pixels of "+image.Width*image.Height + " belonging to pixels' set " + index + ".");

}
```
I get correct results for the first and the last image (the one without modifications and the one with pixels of all subsets, which are not all the pixels of the image, blackned out), while I get completely black images for those one I try to change only pixels from one subset. What freaks me the most is that if there was a bug in my code, shouldn't it happen for the last image aswell?
Comments: I am using Accord.MachineLearning, clusters.Nearest just returns the index of the cluster which the tuple belongs to. Yes I am sure it has 3 channels and the k-means has been performed with k = lightSourceNumber. I've obtained the wished result just by switching to Bitmap with magickimage.toBitmap() and changing that instead. I didn't think it was a Magick.NET bug, I thought there was a bug in my code, as I said. I just wish I knew what I was doing wrong though, what I have know works but feels like a crappy workaround.

Commented Unassigned: MagickImage gets completely black after changing some pixel. [1400]

$
0
0
Hello,
I am trying to create different versions of an image, each one with a particular set of pixels blackened out. In the following code I have my lightSourceNumber set to 2, and I want to obtain 2^2 images: the original one, one that has pixels of set 1 blackned out, one that has pixels of set 2 blackned out and one that has all pixels of those 2 sets blackned out. These sets are subsets of the complete set of pixels and their cardinality is relatively low with respect to the superset's.

I begin with this:
```
MagickImage[] result = new MagickImage[numberOfEnvMaps];
for(int i = 0; i < result.Length; i++)
{
result[i] = new MagickImage(original);
}
```
for initialization, then I compute the sets I want and store them in a array with components (x,y,L), each component is in [0,1] range.

To black out pixels I use this for loop (note: I am using Accord.MachineLearning library for k-means):
```
KMeansClusterCollection lightClusters = kmeansEuclidean.Clusters;
for (int i = 0; i < result.Length; i++)
{
Console.WriteLine("Image" + i+".");
for (int j = 0; j < lightSourceNumber; j++)
{
int num = i & (int)Math.Pow(2, j);
if (num > 0) //if j-th bit is set to 1 i black-out pixels of that set
{
Console.WriteLine("Delete pixels set " + j + " from Image " + i+".");
ObscurePixels(ref result[i], ref brightestPixelsSet, lightClusters, j);

}
}

result[i].Write(@"../../OccludedImages/EnvMap_" + i + ".jpg");
}
```
And ObscurePixels is:
```
protected void ObscurePixels(ref MagickImage image, ref double[][] pixelSet, KMeansClusterCollection clusters, int index)
{
float[] black = { 0f, 0f, 0f }; //image has 3 channels
PixelCollection pixelsOfTheImage = image.GetPixels();
int count = 0;
foreach(double[] pixel in pixelSet)
{
if (clusters.Nearest(pixel) == index)
{
count++;
int x = (int)Math.Round(pixel[X_COMP] * image.Width);
int y = (int)Math.Round(pixel[Y_COMP] * image.Height);
pixelsOfTheImage.Set(x,y,black);
}
}
Console.WriteLine("Blackned " + count + " pixels of "+image.Width*image.Height + " belonging to pixels' set " + index + ".");

}
```
I get correct results for the first and the last image (the one without modifications and the one with pixels of all subsets, which are not all the pixels of the image, blackned out), while I get completely black images for those one I try to change only pixels from one subset. What freaks me the most is that if there was a bug in my code, shouldn't it happen for the last image aswell?
Comments: I am sorry but you completely lost me with the .ToBitmap. I just noticed now that you are not putting the PixelCollection inside a using block. Can you put it one and see if that resolves your issue? The rest of your code looks okay.

Closed Unassigned: Error 'The type initializer for 'X86' threw an exception.' [1395]

$
0
0
We are trying to create a Windows Service which deals with Adobe image files and converts them to Thumbnails.

The service runs fine on our test machines which run Windows 7 but when we run the same service on our utils box which runs unders Windows Server 2012 it throws an error 'The type initializer for 'X86' threw an exception.'

We are using the multi CPU DLL in our project but we are unable to install Magick as we did in our test machines by running Configure.sln under Visual Studio 2013 and compiling to produce an install process.

Is there another way to install Magick on our server which doesn't have Visual Studio or are we missing some other process?

Commented Unassigned: Issue when converting a PDF to PNG [1394]

$
0
0
I have noticed issues when converting large PDF (3.5MB and higher) that it freezes the system, and in the course of 5 minutes will create temp files over 10GB in size.

Let me know if you need any info
Comments: I still haven't received a reply from you. Is your problem resolved?

Commented Issue: ObjectDisposedException since 7.0.1 [1398]

$
0
0
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: The new release has been published and should resolve your issue. Can you confirm this?

Commented Unassigned: Issue when converting a PDF to PNG [1394]

$
0
0
I have noticed issues when converting large PDF (3.5MB and higher) that it freezes the system, and in the course of 5 minutes will create temp files over 10GB in size.

Let me know if you need any info
Comments: I apologize for my lateness in a reply. I never got your reply. Below is a public link to a couple of files with the same issue. https://1drv.ms/f/s!AvH236MLUF6ehlArSpGcrMBcj00Q

Closed Unassigned: MagickImage gets completely black after changing some pixel. [1400]

$
0
0
Hello,
I am trying to create different versions of an image, each one with a particular set of pixels blackened out. In the following code I have my lightSourceNumber set to 2, and I want to obtain 2^2 images: the original one, one that has pixels of set 1 blackned out, one that has pixels of set 2 blackned out and one that has all pixels of those 2 sets blackned out. These sets are subsets of the complete set of pixels and their cardinality is relatively low with respect to the superset's.

I begin with this:
```
MagickImage[] result = new MagickImage[numberOfEnvMaps];
for(int i = 0; i < result.Length; i++)
{
result[i] = new MagickImage(original);
}
```
for initialization, then I compute the sets I want and store them in a array with components (x,y,L), each component is in [0,1] range.

To black out pixels I use this for loop (note: I am using Accord.MachineLearning library for k-means):
```
KMeansClusterCollection lightClusters = kmeansEuclidean.Clusters;
for (int i = 0; i < result.Length; i++)
{
Console.WriteLine("Image" + i+".");
for (int j = 0; j < lightSourceNumber; j++)
{
int num = i & (int)Math.Pow(2, j);
if (num > 0) //if j-th bit is set to 1 i black-out pixels of that set
{
Console.WriteLine("Delete pixels set " + j + " from Image " + i+".");
ObscurePixels(ref result[i], ref brightestPixelsSet, lightClusters, j);

}
}

result[i].Write(@"../../OccludedImages/EnvMap_" + i + ".jpg");
}
```
And ObscurePixels is:
```
protected void ObscurePixels(ref MagickImage image, ref double[][] pixelSet, KMeansClusterCollection clusters, int index)
{
float[] black = { 0f, 0f, 0f }; //image has 3 channels
PixelCollection pixelsOfTheImage = image.GetPixels();
int count = 0;
foreach(double[] pixel in pixelSet)
{
if (clusters.Nearest(pixel) == index)
{
count++;
int x = (int)Math.Round(pixel[X_COMP] * image.Width);
int y = (int)Math.Round(pixel[Y_COMP] * image.Height);
pixelsOfTheImage.Set(x,y,black);
}
}
Console.WriteLine("Blackned " + count + " pixels of "+image.Width*image.Height + " belonging to pixels' set " + index + ".");

}
```
I get correct results for the first and the last image (the one without modifications and the one with pixels of all subsets, which are not all the pixels of the image, blackned out), while I get completely black images for those one I try to change only pixels from one subset. What freaks me the most is that if there was a bug in my code, shouldn't it happen for the last image aswell?

Commented Issue: ObjectDisposedException since 7.0.1 [1398]

$
0
0
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: yes I can, thank you very much!
Viewing all 1011 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>