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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user