]> git.wh0rd.org Git - tt-rss.git/commitdiff
do no try to pass MS icon files to GD
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Sat, 15 Jun 2013 09:15:20 +0000 (13:15 +0400)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Sat, 15 Jun 2013 09:15:20 +0000 (13:15 +0400)
include/colors.php

index 070be06a2363a1d3f35be8968557128fc055f70f..491d38c1556f1abe41bf7afac5b3a4c9b1194727 100644 (file)
@@ -288,15 +288,22 @@ function hsl2rgb($arr) {
 
                $size = @getimagesize($imageFile);
 
-               if (strtolower($size['mime']) == 'image/vnd.microsoft.icon' && class_exists("floIcon")) {
+               // to enable .ico support place floIcon.php into lib/
+               if (strtolower($size['mime']) == 'image/vnd.microsoft.icon') {
 
-                       $ico = new floIcon();
-                       @$ico->readICO($imageFile);
+                       if (class_exists("floIcon")) {
 
-                       if(count($ico->images)==0)
-                               return null;
-                       else
-                               $img = @$ico->images[count($ico->images)-1]->getImageResource();
+                               $ico = new floIcon();
+                               @$ico->readICO($imageFile);
+
+                               if(count($ico->images)==0)
+                                       return false;
+                               else
+                                       $img = @$ico->images[count($ico->images)-1]->getImageResource();
+
+                       } else {
+                               return false;
+                       }
 
                } else if ($size[0] > 0 && $size[1] > 0) {
                   $img = @imagecreatefromstring(file_get_contents($imageFile));