You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Bun.Image: CMYK JPEG decode fails with "Image: decode failed" #31895
The CMYK JPEG is decoded and re-encoded to sRGB, like libvips/sharp and ImageMagick do (they auto-convert CMYK→sRGB on output).
What do you see instead?
The pipeline throws Image: decode failed.
Notably, await new Bun.Image(bytes).metadata()succeeds and returns { width, height, format: "jpeg" } — the header parses fine, but pixel decoding of 4-component (CMYK / YCCK) JPEGs fails.
Additional information
CMYK JPEGs are common in print-oriented / publishing image libraries. sharp (libvips) and ImageMagick both decode them and convert to sRGB. This currently forces a fallback to sharp for the affected images.
✅ Reproduced on 1.4.0: metadata() parses the header but pixel decode of 4-component (CMYK/YCCK) JPEGs throws Image: decode failed.
Fix → #31898, ready for a maintainer to merge. The image tests pass on every CI lane that ran them; the remaining red lanes are unrelated failures that also occur on main.
Activity
robobun commentedon Jun 5, 2026
✅ Reproduced on 1.4.0:
metadata()parses the header but pixel decode of 4-component (CMYK/YCCK) JPEGs throwsImage: decode failed.Fix → #31898, ready for a maintainer to merge. The image tests pass on every CI lane that ran them; the remaining red lanes are unrelated failures that also occur on main.
Decode CMYK and YCCK JPEGs in Bun.Image
Decode CMYK and YCCK JPEGs in Bun.Image
Decode CMYK and YCCK JPEGs in Bun.Image (#31898)