Files
convert-ui/lib
Sebastian Krüger b9f9a7bea6 fix: correct ImageMagick write API to produce valid WebP data
The previous implementation was producing invalid image data with
wrong magic bytes (d0 e5 67 00 instead of 52 49 46 46 for WebP).

Root cause: Incorrect usage of ImageMagick write API.

Changes:
- Set image.format BEFORE writing (tells ImageMagick the output format)
- Simplified write() call to: image.write((data) => data)
- This returns the correctly formatted image data

The proper pattern is:
1. Set image.format = outputFormatEnum
2. Apply transformations (quality, resize)
3. Call image.write() which returns the encoded data

This should now produce valid WebP files with correct RIFF header
(52 49 46 46) and allow the preview to display properly.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-17 12:25:31 +01:00
..