summaryrefslogtreecommitdiff
path: root/include/colors.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2013-05-19 13:51:23 +0400
committerAndrew Dolgov <[email protected]>2013-05-19 13:51:23 +0400
commit82852ecd33a8e96a303737f889eab2fcdade3bfb (patch)
tree300ce18cf114b43bc6a0032a71008f2dee14281e /include/colors.php
parent8e74763dc8fd4a4111704e236527797b4336dc6f (diff)
Revert "remove floicon because its author is a colossal shitlord (http://tt-rss.org/forum/viewtopic.php?f=1&t=2055&p=10824#p10822)"
This reverts commit dce5037888968788518dfdb6b1c29f3863238b92.
Diffstat (limited to 'include/colors.php')
-rw-r--r--include/colors.php16
1 files changed, 15 insertions, 1 deletions
diff --git a/include/colors.php b/include/colors.php
index 477a7bd86..41bf7b819 100644
--- a/include/colors.php
+++ b/include/colors.php
@@ -1,5 +1,7 @@
<?php
+require_once "lib/floIcon.php";
+
function _resolve_htmlcolor($color) {
$htmlcolors = array ("aliceblue" => "#f0f8ff",
"antiquewhite" => "#faebd7",
@@ -283,7 +285,19 @@ function hsl2rgb($arr) {
$colors = array();
$size = @getimagesize($imageFile);
- $img = @imagecreatefromstring(file_get_contents($imageFile));
+
+ if (!defined('_DISABLE_FLOICON') && strtolower($size['mime']) == 'image/vnd.microsoft.icon') {
+ $ico = new floIcon();
+ @$ico->readICO($imageFile);
+
+ if(count($ico->images)==0)
+ return null;
+ else
+ $img = @$ico->images[count($ico->images)-1]->getImageResource();
+
+ } else {
+ $img = @imagecreatefromstring(file_get_contents($imageFile));
+ }
if (!$img) return false;