Jump to content

Windows Metafile: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
added a link to clip art page
Line 11: Line 11:
| extendedto =
| extendedto =
}}
}}
'''Windows Metafile''' ('''WMF''') is a [[Image file formats|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 graphics|raster formats]] such as [[JPEG]] and [[Graphics Interchange Format|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.
'''Windows Metafile''' ('''WMF''') is a [[Image file formats|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 graphics|raster formats]] such as [[JPEG]] and [[Graphics Interchange Format|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.


Essentially, a WMF file stores a list of function calls that have to be issued to the Windows graphics layer [[Graphics Device Interface|GDI]] in order to display an image on screen. Since some GDI functions accept [[pointer]]s to [[Callback (computer science)|callback function]]s for [[error handling]], a WMF file may include executable code.
Essentially, a WMF file stores a list of function calls that have to be issued to the Windows graphics layer [[Graphics Device Interface|GDI]] in order to display an image on screen. Since some GDI functions accept [[pointer]]s to [[Callback (computer science)|callback function]]s for [[error handling]], a WMF file may include executable code.

Revision as of 08:55, 30 October 2008

Windows Metafile
Filename extension
.wmf, .emf, .wmz, .emz
Internet media typeimage/wmf
Developed byMicrosoft
Type of formatImage 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.

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].

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]

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.

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 the saving of 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.

See also

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 2008-06-01.
  2. ^ Caolan McNamara. "Window Metafile (wmf) Reference". Retrieved 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 2008-06-01.
  4. ^ "Microsoft Open Specification Promise". Retrieved 2008-06-01.

Tutorials and articles

Applications

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