summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorChih-Hsuan Yen <[email protected]>2023-02-10 18:20:42 +0800
committerChih-Hsuan Yen <[email protected]>2023-02-10 18:20:42 +0800
commit40afee5d1295729105dbebf7f042ccdadd9fae41 (patch)
tree671fda0b8620f033e0967578511778399d43b7af /include
parent0cd4abe4eb3e1e326a942a2141f118cb3bba9abd (diff)
Fix calculating average color for *.ico
Currently colorPalette() always fails for *.ico due to a logic error. It's a regression from 8f749fe61b038833069c4e2d0dec4749643b4371.
Diffstat (limited to 'include')
-rw-r--r--include/colors.php3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/colors.php b/include/colors.php
index 5682b55a1..64e24f8f1 100644
--- a/include/colors.php
+++ b/include/colors.php
@@ -355,8 +355,9 @@ function colorPalette(string $imageFile, int $numColors, int $granularity = 5):
} else {
$img = @$ico->images[count($ico->images)-1]->getImageResource();
}
+ } else {
+ return null;
}
- return null;
} else if ($size[0] > 0 && $size[1] > 0) {
$img = @imagecreatefromstring(file_get_contents($imageFile));
}