fix: use correct MIME types for image preview #491

Merged
ZacharyZcR merged 1 commits from fix/image-preview into dev-1.10.1 2026-01-12 07:29:35 +00:00
ZacharyZcR commented 2026-01-11 12:22:51 +00:00 (Migrated from github.com)

Summary

  • Replace image/* wildcard with specific MIME types in data URLs
  • Add MIME type mapping for common image formats (png, jpg, gif, webp, bmp, ico, tiff)

Root cause: data:image/*;base64,... uses a wildcard MIME type which is not valid in data URLs. Browsers require specific MIME types like image/png or image/jpeg.

Before: data:image/*;base64,{content} → browser fails to parse
After: data:image/png;base64,{content} → browser renders correctly

Related to #408

## Summary - Replace `image/*` wildcard with specific MIME types in data URLs - Add MIME type mapping for common image formats (png, jpg, gif, webp, bmp, ico, tiff) **Root cause**: `data:image/*;base64,...` uses a wildcard MIME type which is not valid in data URLs. Browsers require specific MIME types like `image/png` or `image/jpeg`. **Before**: `data:image/*;base64,{content}` → browser fails to parse **After**: `data:image/png;base64,{content}` → browser renders correctly Related to #408
Sign in to join this conversation.