Skip navigation

Changelog

Release history

2.1.1

๐Ÿ› Bug fixes

  • Fix source files being deleted if thumb generation failed or is unsupported (#10)

2.1.0

๐ŸŽ‰ Features

  • Add hasTransparency() file/asset method โ€” detect if an image has transparent pixels via the thumbhash decode cache

2.0.2

๐Ÿ› Bug fixes

  • Fix implicit float-to-int conversion when using ratio as cache array key

2.0.1

๐Ÿ› Bug fixes

  • Fix imagedestroy() deprecation warning on PHP 8.5
  • Fix encoding with custom ratio returning cached result from first ratio (#9)

2.0.0

Breaking Changes

  • Requires PHP 8.3+ (was 8.2+)
  • Requires Kirby 5.0+ (was 4.0+)

All existing code continues to work.

What's New

  • Average color extraction: averageColor() and averageColorRgba()
  • Image processing drivers: GD (default) or Imagick
  • Cleaner parameter syntax (old array syntax still supported)
  • Better error handling in debug mode

New Syntax

// New
$file->thumbhash(16/9);
$file->thumbhashUri(16/9, 2);
$file->averageColor('rgb', 16/9);

// Old (still works, will be removed in v3.0)
$file->thumbhash(['ratio' => 16/9]);
$file->thumbhashUri(['ratio' => 16/9, 'blurRadius' => 2]);

New Methods

$file->averageColor();        // '#FF8800AA'
$file->averageColor('rgb');   // 'rgb(255 136 0 / 0.67)'
$file->averageColor('rgba');  // 'rgba(255, 136, 0, 0.67)'
$file->averageColorRgba();    // ['r' => 255, 'g' => 136, 'b' => 0, 'a' => 0.67]

Optional: Use Imagick Driver

pecl install imagick
// config.php
return [
    'tobimori.thumbhash.engine' => 'imagick',
];

Full Changelog: https://github.com/tobimori/kirby-thumbhash/compare/1.1.1...2.0.0

1.1.1

1.1.0

This release enables the encode & decode file caching by default and should significantly speed up your site.

Full Changelog: https://github.com/tobimori/kirby-thumbhash/compare/1.0.0...1.1.0

1.0.0

Initial release