diff options
author | Andrew Dolgov <[email protected]> | 2013-06-15 13:15:20 +0400 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2013-06-15 13:15:20 +0400 |
commit | a586afa37d0880df810cc9f9477dbb4280eabeb2 (patch) | |
tree | 9840d968b60301e6c790febeaae04706666ae170 | |
parent | 8d1cfe8020404e2c4c9a2022fa75707582b26997 (diff) |
do no try to pass MS icon files to GD
-rw-r--r-- | include/colors.php | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/include/colors.php b/include/colors.php index 070be06a2..491d38c15 100644 --- a/include/colors.php +++ b/include/colors.php @@ -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)); |