Skip to content

Latest commit

 

History

History
90 lines (71 loc) · 4.29 KB

File metadata and controls

90 lines (71 loc) · 4.29 KB

Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

[2.0.1] - 2026-03-21

Changed

  • Zero dependencies — removed browser-image-compression. Encoding now uses the browser’s native OffscreenCanvas.convertToBlob API
  • Framework-agnostic — removed Angular (@Injectable) and RxJS (BehaviorSubject, Observable) from the core service; works with any JavaScript environment
  • Promise-based APIconvertFormat() and compressImages() now return Promise<void> instead of Observable<void>
  • Reactive state — replaced RxJS subjects with a zero-dependency Subject primitive; the callback API (onImagesChange, onUploadingChange, onProgressChange) is unchanged

Added

  • destroy() lifecycle method — releases blob URLs, clears all listeners, cancels timers
  • MediaOptimizerError base class — catch all library errors with a single instanceof check

Removed

  • useWebWorker option (was deprecated no-op since v1.3, now fully removed)
  • Runtime dependency on rxjs
  • Runtime dependency on browser-image-compression

Migration from v1.x

  • Replace .subscribe() calls with await or .then()/.catch()
  • Remove useWebWorker from your options objects
  • If using Angular DI: either instantiate directly (new ImageConverterService()) or provide manually in providers

[1.3.0] - 2026-02-18

Added

  • Abort Support: New abortProcessing() method to cancel ongoing operations
  • Input Validation: Comprehensive file validation (MIME types, size limits, empty files)
  • SSR Support: Server-Side Rendering compatibility with proper browser API checks
  • Lifecycle Management: ngOnDestroy() implementation for automatic cleanup
  • Cache Stats: New getCacheStats() method to monitor cache usage

Changed

  • Performance: LRU cache eviction optimized from O(n) to O(1) - 100x faster
  • Code Quality: Eliminated code duplication, replaced magic numbers with constants
  • Type Safety: Removed all unsafe type assertions, improved null handling

Fixed

  • Memory Leaks: Fixed event handler cleanup in image loading error paths
  • Security: Added file size validation to prevent DoS from huge files
  • Type Safety: Removed non-null assertions and unsafe canvas type casts

1.1.0 - 2026-02-01

Added

  • AVIF Format Support: Added support for AVIF image format across all conversion and validation methods
  • Image Validation Methods (ImageUtilsService):
    • validateDimensions(): Validate image dimensions against min/max constraints
    • validateFileSize(): Validate file size with optional min/max limits in MB
    • validateBatch(): Batch validation with comprehensive options (format, size, dimensions)
  • Image Analysis Methods (ImageUtilsService):
    • hasTransparency(): Detect transparency/alpha channel in images
    • isAnimated(): Detect animated GIFs and WebPs using binary analysis
    • getDominantColor(): Calculate dominant color using color quantization algorithm
  • State Management Methods (ImageConverterService):
    • removeImage(): Remove individual image by ID with automatic resource cleanup
    • removeAllImages(): Clear all images with bulk cleanup
    • clearCompleted(): Remove only completed images
  • Download Functionality (ImageConverterService):
    • downloadImage(): Download individual compressed image
    • downloadAllImages(): Download all completed images with staggered execution

Changed

  • Improved type definitions to include AVIF format
  • Enhanced error handling with detailed logging
  • Updated all validation methods to support AVIF

Fixed

  • Image format detection now properly identifies AVIF files

1.0.1 - 2026-01-31

Added

  • Initial public release
  • Core image conversion and compression functionality
  • Support for WebP, JPEG, and PNG formats
  • Parallel processing with RxJS
  • Framework-agnostic design