UnableToReadImageData Error

Magick.NET is an object-oriented C# interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning Magick.NET
Post Reply
pieterv
Posts: 1
Joined: 2015-11-04T10:06:54-07:00
Authentication code: 1151

UnableToReadImageData Error

Post by pieterv »

I am using C# and I am converting wmf to svg and I get the following error
WmfToSVG.vshost.exe: UnableToReadImageData `C:/Users/pieterv/AppData/Local/Temp/magick-28656-E3tgAU5Xj41' @ error/emf.c/ReadEMFImage/750

It used to work fine but all of a sudden did this.

Thanks for your help

Here is my code

Code: Select all

List<WmfToSVG.DoorImage> Images = Database.DoorImages.ToList();

            if (Images != null)
            {
                foreach (WmfToSVG.DoorImage Image in Images)
                {
                    if (Image != null)
                    {
                        try
                        {
                            using (MagickImage MagicImage = new MagickImage(((byte[])Image.Image.ToArray())))
                            {
                                MagicImage.Format = MagickFormat.Svg;
                                string svg = Encoding.UTF8.GetString(MagicImage.ToByteArray());
                                Image.SVG = svg;
                                Database.SaveChanges();
                            }
                        }
                        catch
                        {
                        }
                        finally
                        {
                            backgroundWorker1.ReportProgress(1);
                        }
                    }
                }
            }
User avatar
dlemstra
Posts: 1570
Joined: 2013-05-04T15:28:54-07:00
Authentication code: 6789
Contact:

Re: UnableToReadImageData Error

Post by dlemstra »

Can you post a link to you input file? Feel free to send me a PM or contact me on CodePlex if you don't want to share the image publicly.

EDIT: You should also realize that the SVG created is just a bunch of dots. You might want to take a look at another tool if you need high quality svg files.
.NET + ImageMagick = Magick.NET https://github.com/dlemstra/Magick.NET, @MagickNET, Donate
Post Reply