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

Closed 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: Can you also add a small code example to onedrive that demonstrates the issue?

Created Unassigned: Resize threw exception once [1401]

$
0
0
After calling resize I once (and only once) got this error
ImageMagick.MagickBlobErrorException: unable to write blob '(null)\magick_opencl_GeForce_GT_520_3d40ccf0_32.bin': No such file or directory @ error/blob.c/BlobToFile/266
at ImageMagick.NativeInstance.CheckException(IntPtr exception, IntPtr result)
at ImageMagick.MagickImage.NativeMagickImage.Resize(String geometry)
at ImageMagick.MagickImage.Resize(MagickGeometry geometry)

after that resize worked fine when called again (even on the same picture). Any ideas what could be the reason?

Commented Unassigned: Resize threw exception once [1401]

$
0
0
After calling resize I once (and only once) got this error
ImageMagick.MagickBlobErrorException: unable to write blob '(null)\magick_opencl_GeForce_GT_520_3d40ccf0_32.bin': No such file or directory @ error/blob.c/BlobToFile/266
at ImageMagick.NativeInstance.CheckException(IntPtr exception, IntPtr result)
at ImageMagick.MagickImage.NativeMagickImage.Resize(String geometry)
at ImageMagick.MagickImage.Resize(MagickGeometry geometry)

after that resize worked fine when called again (even on the same picture). Any ideas what could be the reason?
Comments: forgot to mention I am using latest version downloaded today

Commented Unassigned: Resize threw exception once [1401]

$
0
0
After calling resize I once (and only once) got this error
ImageMagick.MagickBlobErrorException: unable to write blob '(null)\magick_opencl_GeForce_GT_520_3d40ccf0_32.bin': No such file or directory @ error/blob.c/BlobToFile/266
at ImageMagick.NativeInstance.CheckException(IntPtr exception, IntPtr result)
at ImageMagick.MagickImage.NativeMagickImage.Resize(String geometry)
at ImageMagick.MagickImage.Resize(MagickGeometry geometry)

after that resize worked fine when called again (even on the same picture). Any ideas what could be the reason?
Comments: You are getting this exception because ImageMagick tries to safe the OpenCL kernel to disk. I have no idea why it says '(null)' though. I will investigate this and get back to you when I know more.

Edited Issue: Resize threw exception once [1401]

$
0
0
After calling resize I once (and only once) got this error
ImageMagick.MagickBlobErrorException: unable to write blob '(null)\magick_opencl_GeForce_GT_520_3d40ccf0_32.bin': No such file or directory @ error/blob.c/BlobToFile/266
at ImageMagick.NativeInstance.CheckException(IntPtr exception, IntPtr result)
at ImageMagick.MagickImage.NativeMagickImage.Resize(String geometry)
at ImageMagick.MagickImage.Resize(MagickGeometry geometry)

after that resize worked fine when called again (even on the same picture). Any ideas what could be the reason?

Edited Issue: Resize threw exception once [1401]

$
0
0
After calling resize I once (and only once) got this error
ImageMagick.MagickBlobErrorException: unable to write blob '(null)\magick_opencl_GeForce_GT_520_3d40ccf0_32.bin': No such file or directory @ error/blob.c/BlobToFile/266
at ImageMagick.NativeInstance.CheckException(IntPtr exception, IntPtr result)
at ImageMagick.MagickImage.NativeMagickImage.Resize(String geometry)
at ImageMagick.MagickImage.Resize(MagickGeometry geometry)

after that resize worked fine when called again (even on the same picture). Any ideas what could be the reason?

Commented Issue: Resize threw exception once [1401]

$
0
0
After calling resize I once (and only once) got this error
ImageMagick.MagickBlobErrorException: unable to write blob '(null)\magick_opencl_GeForce_GT_520_3d40ccf0_32.bin': No such file or directory @ error/blob.c/BlobToFile/266
at ImageMagick.NativeInstance.CheckException(IntPtr exception, IntPtr result)
at ImageMagick.MagickImage.NativeMagickImage.Resize(String geometry)
at ImageMagick.MagickImage.Resize(MagickGeometry geometry)

after that resize worked fine when called again (even on the same picture). Any ideas what could be the reason?
Comments: I found out what was causing this and it will be resolved in the next version of Magick.NET. Your issue will be resolved with the current release if you disable OpenCL with `OpenCL.IsEnabled=false`.

Commented Issue: Resize threw exception once [1401]

$
0
0
After calling resize I once (and only once) got this error
ImageMagick.MagickBlobErrorException: unable to write blob '(null)\magick_opencl_GeForce_GT_520_3d40ccf0_32.bin': No such file or directory @ error/blob.c/BlobToFile/266
at ImageMagick.NativeInstance.CheckException(IntPtr exception, IntPtr result)
at ImageMagick.MagickImage.NativeMagickImage.Resize(String geometry)
at ImageMagick.MagickImage.Resize(MagickGeometry geometry)

after that resize worked fine when called again (even on the same picture). Any ideas what could be the reason?
Comments: Thanks. For now I disabled OpenCL

Commented Unassigned: Crashes my disply driver [1393]

$
0
0
Hi,

I am trying to resize an image. Below is my code. It takes huge time and crashes my display driver.

Let me know how to fix the problem.

Thanks

```
private static void ConvertImgUsingMagickDotnet(string sourceImg, string targetImg)
{
MagickReadSettings settings = new MagickReadSettings();
// Settings the density to 600 dpi will create an image with a better quality
settings.Density = new Density(600);

// Read first frame of gif image
using (MagickImage image = new MagickImage(sourceImg, settings))
{
//When zero is specified for the height, the height will be calculated with the aspect ratio.
image.Resize(479, 0);
// Save frame as jpg
image.Write(targetImg);
}
}
```
Comments: I also have this issue after updating to the latest 7.0.2.100 version, after a long time using an old version. Disabling OpenCL does fix the problem, but is this not a bug in ImageMagick (or Magick.NET)? The old version, 7.0.0.0102, works fine and my drivers haven't changed.

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've run into essentially the same issue, but overall, I don't think this is a bug, just more of a performance issue. When running what is basically the example of converting a PDF into multiple PNG images with a reasonably large file (26MB), I see ~25% CPU usage, and upwards of 12GB of memory during the peak of reading the file. I printed to PDF the HTML ebook from Project Gutenburg ["Les Miserables"](https://www.gutenberg.org/files/135/135-h/135-h.htm) for this sample. This is the one-file program I used linked to .NETCoreApp (v1.0), in conjunction with Magick.NET.Core-Q8 v7.0.2.100. ``` using ImageMagick; using System; using System.IO; namespace DocumentConverter { public class Program { public static void Main(string[] args) { var name = @"Les Misérables, Five Volumes, Complete by Victor Hugo"; var cwd = Directory.GetCurrentDirectory(); MagickNET.SetTempDirectory(Path.Combine(cwd, "temp")); // Read the default settings and override the density to 300 dpi for better quality MagickReadSettings settings = new MagickReadSettings(); settings.Density = new Density(300, 300); using (MagickImageCollection images = new MagickImageCollection()) { // Add all the pages of the pdf to the collection images.Read(Path.Combine(cwd, $"{name}.pdf"), settings); int page = 1; foreach (MagickImage image in images) { // Write page to file that contains page number image.Write(Path.Combine(cwd, "out", $"{name} (page {page}).png")); page++; } } } } } ``` During execution, the program "hung" at 'images.Read()', which synchronously read the file into memory and seemed to write temp files for each page of the PDF (899 pages) in the assigned temp directory, then it appeared to roll-up those files into 32MB chunks. This process took approximately 45 minutes, and peaked the consumption of memory at about 12GB, which also ended up consuming approximately 14GB of harddrive space for the temp files. It started shedding memory consumption when it started rolling up the individual page temp files into the chunks. Once it reached to foreach loop, it retained the entire contents of the temp directory throughout the process, and sequentially wrote out each PNG file, taking about a second per image. It also, again started to creep it's memory usage during this process, but didn't really go up past 12GB, fluctuating between 10GB and 11GB through most of the process. All of these stats are based on TaskManager readings and wall-clock timings, they are not at all accurate, but do paint a reasonable picture that the process of splitting a PDF into individual PNGs is not a very quick or efficient 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: It will be probably be faster if you read the PDF file page by page. Otherwise it will need to put a lot of images into your memory. At some point it will swap to disk and give you terrible performance. There is an example on how to read an individual page here: https://magick.codeplex.com/wikipage?title=Convert%20PDF&referringTitle=Documentation. When you specify a page number that is larger than the number of pages an exception will be raised. You can use that to determine when to stop.

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: Below is the code I have. I need the PDF to append vertical to one image. > public static byte[] ConvertPDFtoPNG(byte[] data) { byte[] output = null; MagickReadSettings settings = new MagickReadSettings(); settings.Density = new PointD(300, 300); using (MagickImageCollection images = new MagickImageCollection()) { images.Read(data, settings); using (MagickImage vertical = images.AppendVertically()) { vertical.Quality = 100; vertical.Format = MagickFormat.Png; vertical.HasAlpha = false; vertical.BackgroundColor = new MagickColor("#FFF"); output = vertical.ToByteArray(); } } return output; }

Closed Issue: Resize threw exception once [1401]

$
0
0
After calling resize I once (and only once) got this error
ImageMagick.MagickBlobErrorException: unable to write blob '(null)\magick_opencl_GeForce_GT_520_3d40ccf0_32.bin': No such file or directory @ error/blob.c/BlobToFile/266
at ImageMagick.NativeInstance.CheckException(IntPtr exception, IntPtr result)
at ImageMagick.MagickImage.NativeMagickImage.Resize(String geometry)
at ImageMagick.MagickImage.Resize(MagickGeometry geometry)

after that resize worked fine when called again (even on the same picture). Any ideas what could be the reason?

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 give it another try with Magick.NET 7.0.2.400? We found another issue that could cause this.

Created Unassigned: Issue with colorizing image using RGB values [1402]

$
0
0
I have an image I'd like to colorize using RGB values (and eventually, HSL), but for whatever reason I'm only able to pass in a hex value as a parameter for my image to be successfully colorized.

Is there anything inherently different between:

image.Colorize(new MagickColor(255, 255, 0), (Percentage)50); -DOES NOT WORK
image.Colorize(new MagickColor("#ffff00"), (Percentage)50); -WORKS

Assistance with this would be greatly appreciated, thanks.

Ben

Closed Unassigned: Issue with colorizing image using RGB values [1402]

$
0
0
I have an image I'd like to colorize using RGB values (and eventually, HSL), but for whatever reason I'm only able to pass in a hex value as a parameter for my image to be successfully colorized.

Is there anything inherently different between:

image.Colorize(new MagickColor(255, 255, 0), (Percentage)50); -DOES NOT WORK
image.Colorize(new MagickColor("#ffff00"), (Percentage)50); -WORKS

Assistance with this would be greatly appreciated, thanks.

Ben
Comments: Next time please only create an issue or a discussion (ref: https://magick.codeplex.com/discussions/656382)

Created Unassigned: Issue on opening large image (>2GB Tiff) [1403]

$
0
0
Hi,

We are using magick.net for getting some image informations (get colorspace, bit per sample, etc.) and in some case, we have to transform the same files (dropped in our main app) to tiff. For getting info, we use the code below. On opening large Tiff (>2GB Tiff), we get instantly an OverflowException, Arithmetic operation resulted in an overflow. at ImageMagick.MagickReader.Read(Stream stream)

Any idea we can overcome this. We currently use the V6 of magick.net. Q8 - X64

The whole project is X64 based, not anyCpu.

```
FileStream imageStream = new FileStream(TiffFile, FileMode.Open, FileAccess.Read);
MagickImage currentImage;
ImageMagick.ColorSpace orgColorspace;

try
{
currentImage = new MagickImage(imageStream);
orgColorspace = currentImage.ColorSpace;

if (currentImage.ReadWarning != null)
{
log.Info("RipTiff : Warning on opening file : " + TiffFile + " : " + currentImage.ReadWarning.Message);
}
}
```

Commented Unassigned: Issue on opening large image (>2GB Tiff) [1403]

$
0
0
Hi,

We are using magick.net for getting some image informations (get colorspace, bit per sample, etc.) and in some case, we have to transform the same files (dropped in our main app) to tiff. For getting info, we use the code below. On opening large Tiff (>2GB Tiff), we get instantly an OverflowException, Arithmetic operation resulted in an overflow. at ImageMagick.MagickReader.Read(Stream stream)

Any idea we can overcome this. We currently use the V6 of magick.net. Q8 - X64

The whole project is X64 based, not anyCpu.

```
FileStream imageStream = new FileStream(TiffFile, FileMode.Open, FileAccess.Read);
MagickImage currentImage;
ImageMagick.ColorSpace orgColorspace;

try
{
currentImage = new MagickImage(imageStream);
orgColorspace = currentImage.ColorSpace;

if (currentImage.ReadWarning != null)
{
log.Info("RipTiff : Warning on opening file : " + TiffFile + " : " + currentImage.ReadWarning.Message);
}
}
```
Comments: Can you share a link to the input image on something like DropBox or OneDrive? I would like to try to read the image with the latest version of Magick.NET and see if I can reproduce the issue. A lot has changed and I don't provide support on the V6 version of Magick.NET

Commented Unassigned: Issue on opening large image (>2GB Tiff) [1403]

$
0
0
Hi,

We are using magick.net for getting some image informations (get colorspace, bit per sample, etc.) and in some case, we have to transform the same files (dropped in our main app) to tiff. For getting info, we use the code below. On opening large Tiff (>2GB Tiff), we get instantly an OverflowException, Arithmetic operation resulted in an overflow. at ImageMagick.MagickReader.Read(Stream stream)

Any idea we can overcome this. We currently use the V6 of magick.net. Q8 - X64

The whole project is X64 based, not anyCpu.

```
FileStream imageStream = new FileStream(TiffFile, FileMode.Open, FileAccess.Read);
MagickImage currentImage;
ImageMagick.ColorSpace orgColorspace;

try
{
currentImage = new MagickImage(imageStream);
orgColorspace = currentImage.ColorSpace;

if (currentImage.ReadWarning != null)
{
log.Info("RipTiff : Warning on opening file : " + TiffFile + " : " + currentImage.ReadWarning.Message);
}
}
```
Comments: I'll drop you the file through PM as this file is not intended to be shared publicly.
Viewing all 1011 articles
Browse latest View live


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