selective-php / image-type

Image type (format) detection for PHP
MIT License
7 stars 4 forks source link

EMF - Windows Enhanced Metafile #40

Closed odan closed 5 years ago

odan commented 5 years ago

EMF - Windows Enhanced Metafile

http://fileformats.archiveteam.org/wiki/Enhanced_Metafile

Enhanced Metafile (EMF) is a vector graphics format native to 32-bit versions of Microsoft Windows. It is the successor to Windows Metafile (WMF).

There is an extension of the format, named Enhanced Metafile Format Plus Extensions (EMF+).

The .emz filename extension is reportedly used for gzip-compressed EMF files.

Windows Enhanced Metafile (EMF) is a graphics format from Microsoft and a successor to Windows Metafile. It extends the arbitrarily scalable vector graphics with the possibility to use raster graphics as filling. In contrast to its predecessor, EMF offers the possibility to work with Bézier curves and can therefore also be used for more complex graphics with curves. EMF can be used as a file format for the exchange of vector data between illustration programs and MS Office applications.

While WMF is a 16-bit format, EMF is a 32-bit format.

Identification

EMF files begin with bytes 01 00 00 00 (representing record type EMR_HEADER), and have ASCII " EMF" (with the leading space) at file offset 40.

EMF+ files are EMF files with the following characteristics. Let n be the 32-bit integer at offset 4. At offset n is the 32-bit integer 0x00000046 (representing record type EMR_COMMENT). At offset n+12 is the ASCII string "EMF+".