Remove unused 'best color' algorithm.

This code is used to efficiently determine the most saturated colour in an image,
Kabuki uses this as the highlight colour on a page, but this styling has always
been disabled in HashRU Pics. Hence, we can safely remove the code, freeing up
some CPU cycles in the process. ;-)
This commit is contained in:
2019-09-29 14:16:50 +02:00
parent 7d3ab166c7
commit 5df7ea8371
4 changed files with 2 additions and 194 deletions

View File

@@ -90,36 +90,6 @@ class Image extends Asset
return $thumbnail->getUrl($width, $height, $crop, $fit, $generate);
}
public function bestColor()
{
// Save some computations if we can.
if (isset($this->meta['best_color']))
return $this->meta['best_color'];
// Find out what colour is most prominent.
$color = new BestColor($this);
$this->meta['best_color'] = $color->hex();
$this->save();
// There's your colour.
return $this->meta['best_color'];
}
public function bestLabelColor()
{
// Save some computations if we can.
if (isset($this->meta['best_color_label']))
return $this->meta['best_color_label'];
// Find out what colour is most prominent.
$color = new BestColor($this);
$this->meta['best_color_label'] = $color->rgba();
$this->save();
// There's your colour.
return $this->meta['best_color_label'];
}
public function getId()
{
return $this->id_asset;