Windows Metafile
From Wikipedia, the free encyclopedia
Filename extension | .wmf, .emf, .wmz, .emz |
---|---|
Internet media type | image/x-wmf, image/x-emf |
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. Most Windows clipart is in the WMF format. With vector graphics, a Windows Metafile can store an image in much less less space than its raster graphics equivalent — 1% to 0.5% of the latter is not unusual. When embedded in documents, the storage space reductions are similarly impressive.
Essentially, a WMF file stores a list of function calls that have to be issued to the Windows Graphics Device Interface (GDI) layer 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.[1]
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) and Compressed Windows Enhanced Metafile (EMZ)[2].
Contents |
[edit] Patents
As with 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.[3] In September 2006, Microsoft published the WMF file format specification[4] in the context of the Microsoft Open Specification Promise, promising to not assert patent rights to file format implementors.[5]
[edit] Windows Metafile vulnerability
In December 2005, a vulnerability was reported to Microsoft by Symantec. It was assessed and classified as critical. In certain cases, the graphics rendering engine allowed remote code execution. This vulnerability was resolved in a security update on January 5, 2006 on Microsoft TechNet (MS06-001) and generally released January 10, 2006. Details can be found in Microsoft Knowledge Base Article "Vulnerability in Graphics Rendering Engine Could Allow Remote Code Execution" (912919). It was also referred to as the WMF (Windows Meta File) vulnerability.
[edit] Alternative implementations
The WMF format was designed to be executed by the Windows GDI layer 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 into other graphic formats. For example, the Batik library is able to render WMF files and convert them to their Scalable Vector Graphics (SVG) equivalent. The Vector Graphics package of the FreeHEP Java library allows the saving of Java2D drawings as EMF files.
EMZ is an EMF file compressed with gzip. One program that directly unpacks EMZ and WMZ files into EMF and WMF files is SpeedCommander 12.
[edit] See also
[edit] References
- ^ "It's not a bug, it's a feature". F-Secure. http://www.f-secure.com/weblog/archives/archive-012006.html#00000761. Retrieved 2009-10-08.
- ^ "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. http://support.microsoft.com/kb/895083. Retrieved 2008-06-01.
- ^ Caolan McNamara. "Window Metafile (wmf) Reference". http://wvware.sourceforge.net/caolan/support.html. Retrieved 2008-06-01. "These opcodes are unimplemented, for the reason that i dont know what they are, no known documentation"
- ^ "MS-WMF: Windows Metafile Format Specification". http://msdn.microsoft.com/en-us/library/cc215212.aspx. Retrieved 2008-06-01.
- ^ "Microsoft Open Specification Promise". http://www.microsoft.com/interop/osp/. Retrieved 2008-06-01.
[edit] External links
This article's use of external links may not follow Wikipedia's policies or guidelines. Please improve this article by removing excessive and inappropriate external links or by converting links into references. (May 2009) |
[edit] Tutorials and articles
- Windows Metafile Format Specification from Microsoft
- Enhanced Metafile Format Specification from Microsoft
- Windows GDI
- File Format Summary at fileformat.info
- WMF operand documentation
- FAQ about Windows Metafile
- EMF/EMF+/EMZ Information at the Undocumented Printing Wiki
[edit] Libraries
- Batik Java library : the WMF to SVG transcoder package can convert WMF Metafiles to SVG
- FreeHEP Java library : the Vector graphics package can convert EMF Metafiles to SVG, or Java2D drawings to EMF
- libWMF, a library for reading WMF Metafiles, which is able to display them or convert them to SVG
- libEMF, a C/C++ library which provides a drawing toolkit to create vector graphics files on POSIX systems
- wmf2svg, a small Java class to convert WMF Metafiles to SVG
- Pixie Java library
- pyemf Python library : pyemf can create EMF metafiles
- Aspose.Metafiles : A Java library for managing metafiles.