]> git.wh0rd.org - tt-rss.git/blobdiff - include/colors.php
Revert "remove floIcon: bugs"
[tt-rss.git] / include / colors.php
index 9e4429a78b769e208f1928375b557dbf112293e9..1359b9e2d8f9978e937593320363df4de11f2788 100644 (file)
@@ -1,5 +1,7 @@
 <?php
 
+require_once "lib/floIcon.php";
+
 function _resolve_htmlcolor($color) {
        $htmlcolors = array ("aliceblue" => "#f0f8ff",
                "antiquewhite" => "#faebd7",
@@ -284,7 +286,18 @@ function hsl2rgb($arr) {
 
                $size = @getimagesize($imageFile);
 
-          $img = @imagecreatefromstring(file_get_contents($imageFile));
+               if (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;