{"id":"image-x-wmf","mimeType":"image/x-wmf","name":"Windows Metafile","shortName":"WMF","category":"Vector \u0026 Metafile Graphics","extensions":[".wmf",".emf"],"description":"The image/x-wmf MIME type represents the Windows Metafile (WMF) format, a native vector image format introduced by Microsoft in the early 1990s for the Windows operating system. As a 16-bit metafile, WMF files store images as a sequence of Graphics Device Interface (GDI) function calls and commands rather than static pixel grids. This allows the vector shapes, lines, and text to scale infinitely without losing quality. It was widely used in early versions of Microsoft Office (such as Word and PowerPoint) for clip art and vector graphics. Due to inherent architectural security vulnerabilities in how early Windows systems parsed GDI commands, and its supersession by the more robust Enhanced Metafile (EMF) format, WMF is largely obsolete and deprecated for modern web and application development.","seo":{"title":"image/x-wmf MIME Type | Developer Reference for Windows Metafile","description":"Complete reference for the image/x-wmf MIME type: Windows Metafile (WMF), GDI vector commands, Microsoft Office clip art, and legacy file detection.","faqs":[{"question":"What is a WMF file?","answer":"A WMF (Windows Metafile) file is a legacy vector graphics format created by Microsoft. Instead of storing pixels like a JPEG or PNG, it stores a list of drawing commands (like 'draw a line here' or 'fill a rectangle with blue') using the Windows GDI API."},{"question":"What is the difference between WMF and EMF?","answer":"WMF is an older 16-bit format designed for 16-bit versions of Windows (like Windows 3.1). EMF (Enhanced Metafile) is its 32-bit successor, introduced with Windows 95, which supports more advanced GDI commands and better device independence."},{"question":"Can I display WMF files on a modern website?","answer":"No. Modern web browsers do not natively support WMF or EMF files. To display them on a website, you must convert them to SVG, PNG, or WebP using graphics libraries or conversion tools like LibreOffice or ImageMagick."}]},"index":{"compression":["Uncompressed (Command Stream)"],"browserSupport":{"score":1,"label":"None"},"commonUses":["Legacy Microsoft Office Clip Art and Icons","Windows GDI Graphics Export","Early Windows Desktop Publishing"]},"technical":{"magicBytes":{"hex":"D7 CD C6 9A (Aldus Placeable Metafile Header) or 01 00 09 00 (Standard WMF Header)","ascii":"\\xD7\\xCD\\xC6\\x9A or \\x01\\x00\\x09\\x00"},"container":"Windows GDI Metafile Command Stream","compressionAlgorithm":["None"],"colorDepth":["Varies based on GDI rendering engine"],"transparency":true,"animation":false,"metadata":{"exif":false,"xmp":false,"iccProfile":false},"alphaChannel":false,"progressiveLoading":false,"hdrSupport":false},"history":{"developer":"Microsoft Corporation","released":"1990","specification":"Microsoft Windows Metafile Format Specification"},"browserSupport":{"chrome":false,"chromeVersion":"None","firefox":false,"firefoxVersion":"None","safari":false,"safariVersion":"None","edge":false,"edgeVersion":"None","internetExplorer":true},"softwareSupport":[{"name":"LibreOffice Draw","logo":""},{"name":"Adobe Illustrator","logo":""},{"name":"Inkscape","logo":""},{"name":"ImageMagick","logo":"image-magic.webp"}],"conversion":{"convertTo":["svg","png","emf"],"convertFrom":["emf","svg","wmf"]},"developer":{"httpHeaders":[{"header":"Content-Type","value":"image/wmf"},{"header":"Content-Type","value":"image/x-wmf"},{"header":"Content-Type","value":"application/x-msmetafile"}],"htmlAccept":"image/wmf, image/x-wmf, application/x-msmetafile, .wmf","fileDetection":["Many WMF files begin with an Aldus Placeable Metafile (APM) header. Check the first 4 bytes for the signature Hex: D7 CD C6 9A.","If the file does not have an APM header, standard 16-bit WMF files typically begin with the record type and version header, starting with Bytes Hex: 01 00 09 00 or 02 00 09 00.","Because WMF files execute GDI rendering commands, security systems frequently flag them if received via untrusted public file uploads due to historical remote code execution vulnerabilities."]},"prosCons":{"pros":["Infinitely scalable vector format that remains remarkably compact for simple geometric illustrations and charts","Historically served as a seamless conduit for copying and pasting vector graphics between disparate Windows applications via the system clipboard"],"cons":["Notoriously plagued by historic security vulnerabilities, making raw WMF parsing a vector for exploits in legacy software","Completely obsolete and unsupported in modern web environments (browsers cannot render them)","Strictly tied to the Windows GDI architecture, making cross-platform rendering inconsistent across Linux and macOS"]},"specifications":{"url":"https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-wmf/4858e39d-2caf-47d3-badc-79f906f0ae32","rfc":"","mimeAliases":["image/wmf","application/x-msmetafile","application/wmf"]},"developerSnippets":{"python":"import magic\n# Libmagic can identify WMF files using the APM or GDI headers\nprint(magic.from_file('clipart.wmf', mime=True)) # Outputs 'image/x-wmf' or 'image/wmf'","nodejs":"const fs = require('fs');\n// Manually checking for the Aldus Placeable Metafile header (D7 CD C6 9A)\nconst buffer = Buffer.alloc(4);\nconst fd = fs.openSync('clipart.wmf', 'r');\nfs.readSync(fd, buffer, 0, 4, 0);\nfs.closeSync(fd);\nconst isWMF = (buffer[0] === 0xD7 \u0026\u0026 buffer[1] === 0xCD \u0026\u0026 buffer[2] === 0xC6 \u0026\u0026 buffer[3] === 0x9A) || (buffer[0] === 0x01 \u0026\u0026 buffer[1] === 0x00);\nconsole.log('Is Windows Metafile (WMF):', isWMF);","go":"import (\n    \"bytes\"\n    \"net/http\"\n)\n// Native Go HTTP detection does not recognize WMF.\n// Check directly for the APM or GDI signatures:\n// isWMF := bytes.HasPrefix(buf, []byte{0xD7, 0xCD, 0xC6, 0x9A}) || bytes.HasPrefix(buf, []byte{0x01, 0x00, 0x09, 0x00})","php":"$mime = mime_content_type('clipart.wmf');\necho $mime; // Standard PHP setups will return 'image/x-wmf' or 'image/wmf' depending on the system magic database"},"relatedFormats":["emf","svg"]}
