Encapsulated PostScript with WMF preview misidentified as EPT

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Posts: 2
Joined: 2019-11-13T16:13:36-07:00
Authentication code: 1152

Encapsulated PostScript with WMF preview misidentified as EPT

Post by j2j »

some weeks ago i had to handle some Encapsulated Postscript binary
files with previews.

When i run identify command with -verbose option version 7.0.9-14 Q16 x64 on
Windows all of these examples are described as "EPT" format (Encapsulated
PostScript with TIFF preview).

For comparison reason i also run other tools for file type identification.
The newest file command version 5.38 {See
https://en.wikipedia.org/wiki/File_(command)} describes inspected examples
correctly like "DOS EPS Binary File", but distinguish 2 variants.

The second variant contains a preview in Windows Metafile (WMF) format
instead of TIFF. The offset and length of WMF preview is stored at offset 12
and 16 as 4 byte little endian and these values are reported by file command
and described in file format summary of the Encapsulated Postscript in the
Encyclopedia of graphics file formats found at URL:

When extracting preview by help of dd command i get embedded preview
image. When i now run ImageMagick identify command on such previews these
files are described correctly "WMF (Windows Meta File)".

So ImageMagick should use for second variant a describing line like
Format: EPT (Encapsulated PostScript with WMF preview)
instead of
Format: EPT (Encapsulated PostScript with TIFF preview)

I hope that second variant will be implemented in a future version
of ImageMagick tools. This should not be so difficult, because other
TIFF variant is already recognized.