Page 1 of 1

UnableToReadImageData Error

Posted: 2015-11-04T10:10:04-07:00
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);
                        }
                    }
                }
            }

Re: UnableToReadImageData Error

Posted: 2015-11-04T14:30:33-07:00
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.