v145 · Web APIs · Media

Remove BMP Extension for Embedding JPEG-or-PNG-in-BMP

Chrome 145 removes support for the non-standard BMP extension that allowed JPEG or PNG data to be embedded inside a BMP file container — an obscure format variant that poses a security risk and is not part of any web standard.

background

The BMP file format has an unofficial extension (BI_JPEG and BI_PNG compression values) that allows embedding a full JPEG or PNG bitstream inside a BMP container. This was originally intended for printer drivers and is not part of any web standard or specification. Chrome's image decoder previously supported this variant; Chrome 145 removes support to reduce attack surface.

Web content that serves standard BMP, JPEG, PNG, WebP, AVIF, or GIF images is unaffected. Only the unusual pattern of JPEG/PNG data wrapped in a BMP container is removed.

concepts

  1. BMP Demo

    Shows standard BMP image loading behaviour and explains the difference between standard BMP (which still works) and the removed JPEG/PNG-in-BMP variant.

  2. Format Guide

    The BMP format structure, the removed BI_JPEG/BI_PNG compression variants, which web image formats to use instead, and how to detect if content was affected.

  3. Sniffer Probe

    Upload a BMP or use a synthesised sample and have the page sniff the DIB header, detect BI_JPEG / BI_PNG compression, and report whether Chrome 145 still decodes it.

  4. Migration Guide

    Drop any .bmp file to instantly check whether it uses the removed BI_JPEG or BI_PNG compression variant. The parser reads the DIB header, highlights the compression field in the hex view, and gives step-by-step migration options.

the change

// Standard BMP images still load fine:
<img src="standard.bmp"> // Works — unaffected

// JPEG-in-BMP or PNG-in-BMP containers: no longer decoded (Chrome 145+)
// These would fail to load / show broken image icon

// If you encounter this in the wild:
// Option 1: Convert to standard JPEG, PNG, or WebP — recommended
// Option 2: Convert to standard BMP (no compression or RLE)

// Detection: BMP files with BI_JPEG (4) or BI_PNG (5) in the
// BITMAPINFOHEADER biCompression field are affected.
// Standard BMP uses BI_RGB (0) or BI_RLE8 (1) / BI_RLE4 (2).

references