{
  "id": 6100671,
  "title": "Ask canvas for a WebP in Safari and you silently get a PNG",
  "url": "https://urgent.news/2026/09/07/ask-canvas-for-a-webp-in-safari-and-you-silently-get-a-png",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-09-07T05:08:30.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/harshit_katheria/ask-canvas-for-a-webp-in-safari-and-you-silently-get-a-png-5hn6"
  },
  "original_language": "en",
  "account": "Safari silently delivers a PNG when a WebP request is made using canvas, despite the fact that the browser supports decoding WebP images. This occurs because the toBlob method doesn't throw an error or return null if the requested format isn't supported. As a result, a user could be sent a PNG with the wrong extension, without any indication that something went wrong. The only way to detect this issue is by checking the blob type after conversion. To properly handle WebP encoding, you must compile the codec to WebAssembly, which introduces additional challenges related to dependency management and build processes.",
  "summary": "Every browser-based WebP converter I looked at is built on one line: canvas . toBlob ( blob => { /* ... */ }, ' image/webp ' , quality ) It's a reasonable place to start. It also has a failure mode that took me an embarrassingly long time to notice. The silent fallback Safari has never supported WebP encoding via canvas. It decodes WebP fine — that landed in Safari 14 — but it will not encode…",
  "key_points": [
    "Safari returns PNG instead of WebP when request made via canvas",
    "toBlob method fails silently if WebP unsupported",
    "Detect issue by checking blob type after conversion"
  ],
  "editors_take": "This silent format swap undermines developers' ability to rely on Safari's WebP support, forcing them to implement extra checks and potentially complicated workarounds to ensure correct image handling.",
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}