Skip to content

1.3.18

Latest

Choose a tag to compare

@github-actions github-actions released this 14 Sep 16:35
· 8 commits to main since this release

This release focuses on robustness, correctness, and testability of the image processing pipeline. It hardens error handling, makes MIME detection more reliable, fixes resize semantics, and prevents hanging processes during external tool execution (FFmpeg/pngquant).

Changes

  • Unified failure policy: unexpected conversion/decoding errors now return original bytes (no uncaught exceptions).
  • MIME detection: More reliable MIME detection from file headers (magic bytes), with safe fallback to original bytes when detection fails.
    • Corrected byte position checking (bytes 8-11) for WEBP files, resolving issues where some WEBP images weren't being detected properly.
    • Improved fallback to Blob.type when header detection fails completely.
  • JPEG EXIF: On EXIF failure, returns JPEG without EXIF instead of failing. Orientation tag is removed before re-applying EXIF to avoid unexpected rotations.
  • TIFF/HEIC handling: Return original bytes when decoding fails (unsupported environment or malformed input).
  • Resize semantics and quality:
    • FILL mode now produces an output canvas of exactly desiredWidth × desiredHeight via center-crop.
    • Crop offsets now use integer math to avoid sub-pixel artifacts and cross-platform rendering differences.
    • Resize-only (format = NONE) now respects the Quality setting for lossy formats (JPEG/WebP). PNG remains lossless.
      • If your Quality is below the browser’s default (JPEG ~0.92; WebP varies by browser): outputs will be smaller and slightly more compressed than before.
      • If your Quality is above the default: outputs will be larger and higher quality than before.
      • If your Quality is near the default: you likely won’t notice much difference.
  • FFmpeg: Added timeout handling and cleanup for FFmpeg operations to prevent hanging.

Potentially Impactful Behavior Changes

  • Fill outputs exact requested dimensions with center-crop (may differ from prior aspect-fit behavior). If you depended on previous Fill or Reduce behavior, review your presets and expected outputs.
  • Header-based MIME detection may choose different code paths vs. relying solely on file.type.
  • Resize-only operations (format = NONE) now respect the quality setting for lossy formats. Previously, resize-only used browser defaults; now it applies your configured quality value, which may produce different file sizes.

Other

  • Updated Typescript from 4.7.4 to 5.9.2 with ES2024 target.
  • Updated ESlint from v5.29 to v8.42 with flat configuration format. Applied consistent code style rules across all TypeScript files.
  • Updated ESBuild from 0.17.3 to 0.25.9.
  • Updated @types/node from v16 to v24.
  • Added Vitest 3.2.4 for testing.