X-Git-Url: https://git.wh0rd.org/?a=blobdiff_plain;f=include%2Fcolors.php;h=c441f7cb189187bb140f86518ce16d89925faf5c;hb=e52034b4bcce994312ce2af31be0a46a70172691;hp=91eaa2dc2c2dd4a1e69ce4097d94234f02a2b1ba;hpb=2505aea5f3b8eb0e79f10566c21857d4237384d2;p=tt-rss.git diff --git a/include/colors.php b/include/colors.php index 91eaa2dc..c441f7cb 100644 --- a/include/colors.php +++ b/include/colors.php @@ -288,17 +288,24 @@ 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); - } else { + 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)); } @@ -341,4 +348,4 @@ function hsl2rgb($arr) { } return ''; } -?> +