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:
@@ -35,12 +35,8 @@ class AlbumIndex extends SubTemplate
|
||||
|
||||
foreach ($photos as $album)
|
||||
{
|
||||
$color = isset($album['thumbnail']) ? $album['thumbnail']->bestColor() : 'ccc';
|
||||
if ($color == 'FFFFFF')
|
||||
$color = 'ccc';
|
||||
|
||||
echo '
|
||||
<div class="landscape" style="border-color: #', $color, '">';
|
||||
<div class="landscape">';
|
||||
|
||||
if ($this->show_edit_buttons)
|
||||
echo '
|
||||
|
||||
@@ -80,19 +80,10 @@ class PhotosIndex extends SubTemplate
|
||||
$this->previous_header = $header;
|
||||
}
|
||||
|
||||
protected function color(Image $image)
|
||||
{
|
||||
$color = $image->bestColor();
|
||||
if ($color == 'FFFFFF')
|
||||
$color = 'ccc';
|
||||
|
||||
return $color;
|
||||
}
|
||||
|
||||
protected function photo(Image $image, $className, $width, $height, $crop = true, $fit = true)
|
||||
{
|
||||
echo '
|
||||
<div class="', $className, '" style="border-color: #', $this->color($image), '">';
|
||||
<div class="', $className, '">';
|
||||
|
||||
if ($this->show_edit_buttons)
|
||||
echo '
|
||||
|
||||
Reference in New Issue
Block a user