Windows Metafile

From Wikipedia, the free encyclopedia

Windows Metafile
File name extension .wmf, .emf, .wmz, .emz
Developed by Microsoft
Type of format Image file formats

Windows Metafile (WMF) is a graphics file format on Microsoft Windows systems, originally designed in the early 1990s. Windows Metafiles are intended to be portable between applications and may contain both vector and bitmap components. In contrast to raster formats such as JPEG and GIF which are used to store bitmap graphics such as photographs, scans and graphics, Windows Metafiles generally are used to store line-art, illustrations and content created in drawing or presentation applications.

Essentially, a WMF file stores a list of function calls that have to be issued to the Windows graphics layer GDI in order to display an image on screen. Since some GDI functions accept pointers to callback functions for error handling, a WMF file may include executable code.

WMF is a 16-bit format introduced in Windows 3.0. It is the native vector format for Microsoft Office applications such as Word, PowerPoint, and Publisher. a newer 32-bit version with additional commands is called Enhanced Metafile (EMF). EMF is also used as a graphics language for printer drivers.

There are also compressed versions of Windows Metafiles known as Compressed Windows Metafile (WMZ) & Compressed Windows Enhanced Metafile (EMZ)[1].

Contents

[edit] Patents

As for other Microsoft file formats, no specification of the format was previously available, and alternative implementations had to reverse engineer existing WMF files, which was difficult and error prone[2]. In September 2006, Microsoft published the WMF file format specification[3] in the context of the Microsoft Open Specification Promise, promising to not assert patent rights to file formats implementors[4].

[edit] Windows Metafile vulnerability

Exploits using the "SetAbortProc" GDI function were discovered in December 2005. The function, which registers an error handler normally intended for use when a print job is cancelled during spooling, allows arbitrary code added to a WMF image to be executed without the permission of the user.

[edit] Alternative implementations

The WMF format was designed to be executed by the Windows graphics layer GDI in order to restore the image, but as the WMF binary files contain the definition of the GDI graphic primitives that constitute this image, it is possible to design alternative libraries that render WMF binary files, or convert them in other graphic formats.

For example, the Batik library is able to render WMF files and convert them to their SVG equivalent. The Vector Graphics package of the FreeHEP Java library allows to save Java2D drawings as EMF files.

EMZ is gzipped EMF. One program that directly unpacks EMZ and WMZ files into EMF and WMF files is SpeedCommander 12.

[edit] See also

[edit] References

  1. ^ You receive a "This file is an unsupported graphic format" error message when you try to insert a picture into a PowerPoint for Mac presentation. Microsoft. Retrieved on 2008-06-01.
  2. ^ Caolan McNamara. Window Metafile (wmf) Reference. Retrieved on 2008-06-01. “These opcodes are unimplemented, for the reason that i dont know what they are, no known documentation
  3. ^ MS-WMF: Windows Metafile Format Specification. Retrieved on 2008-06-01.
  4. ^ Microsoft Open Specification Promise. Retrieved on 2008-06-01.

[edit] External links

[edit] Tutorials and articles

[edit] Applications

[edit] Libraries