EMF conversion error error/emf.c/ReadEMFImage/753

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: EMF conversion error error/emf.c/ReadEMFImage/753

Post by fmw42 »

dlemstra wrote:That won't work Fred. The issue is that the @chri needs to know the density that can be used to create a 3307x image. The big image can only be read if a 'low enough' density is specified. The issue is that @chri wants to figure out the best density.
A few command lines or script can determine that from the identify -verbose information or string formats and fx calculations.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: EMF conversion error error/emf.c/ReadEMFImage/753

Post by snibgo »

Except that identify can't read this file:

Code: Select all

f:\web\im>%IM%identify 00010003_1247.emf

identify.exe: UnableToReadImageData `00010003_1247.emf' @ error/emf.c/ReadEMFImage/753.
It can be read with a low density such as:

Code: Select all

convert -density 20 00010003_1247.emf g.png
Then g.png can be identified. If g.png isn't large enough, convert can be re-run with a larger density.

It's a kludge. We shouldn't have to write a script that reads a file to find out how to read it. I don't know if "identify -ping" could be tweaked to successfully find the dimensions of this image.
snibgo's IM pages: im.snibgo.com
User avatar
dlemstra
Posts: 1570
Joined: 2013-05-04T15:28:54-07:00
Authentication code: 6789
Contact:

Re: EMF conversion error error/emf.c/ReadEMFImage/753

Post by dlemstra »

Thanks for the idea @snibgo. We could automate limiting the width and height of the image but then we need to know what the actual limit is. I will try and see if we can figure out the limit.
.NET + ImageMagick = Magick.NET https://github.com/dlemstra/Magick.NET, @MagickNET, Donate
chri
Posts: 12
Joined: 2012-04-05T03:55:22-07:00
Authentication code: 8675308

Re: EMF conversion error error/emf.c/ReadEMFImage/753

Post by chri »

@dlemstra did you find a way to automate the limiting of the density with which the image is read to the max. possible value?

e.g. convert -units PixelsPerInch -density max %1 -resize 3307x -density 300 %1.jpg
User avatar
dlemstra
Posts: 1570
Joined: 2013-05-04T15:28:54-07:00
Authentication code: 6789
Contact:

Re: EMF conversion error error/emf.c/ReadEMFImage/753

Post by dlemstra »

I have an idea how to do this but I haven't had the time to implement it.
.NET + ImageMagick = Magick.NET https://github.com/dlemstra/Magick.NET, @MagickNET, Donate
chri
Posts: 12
Joined: 2012-04-05T03:55:22-07:00
Authentication code: 8675308

Re: EMF conversion error error/emf.c/ReadEMFImage/753

Post by chri »

any news on this - I'd still be very happy if this feature would be implemented ;)
User avatar
dlemstra
Posts: 1570
Joined: 2013-05-04T15:28:54-07:00
Authentication code: 6789
Contact:

Re: EMF conversion error error/emf.c/ReadEMFImage/753

Post by dlemstra »

I now have an even better solution. In the next version of ImageMagick (6.9.3-7) you will be able to do this:

Code: Select all

convert -size 3307x 00010003_1247.emf -density 300 -units PixelsPerInch 00010003_1247.png
When you specify -size the density will be calculated. With the example above it will make sure the maximum width is 3307 pixels. When you specify both with and height (e.g. 3307x3307) the image will fit inside those bounds. For your image the size will become 3307x869.
.NET + ImageMagick = Magick.NET https://github.com/dlemstra/Magick.NET, @MagickNET, Donate
Post Reply