From 82852ecd33a8e96a303737f889eab2fcdade3bfb Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sun, 19 May 2013 13:51:23 +0400 Subject: 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. --- include/colors.php | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'include/colors.php') 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 @@ "#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; -- cgit v1.2.3