summaryrefslogtreecommitdiff
path: root/include/colors.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2013-04-16 23:22:32 +0400
committerAndrew Dolgov <[email protected]>2013-04-16 23:22:32 +0400
commit4fe9327491ed11661449062e4d476fdc8d8875ab (patch)
tree7cd3c75251c18119f85a1bc4291c554a8437bbd7 /include/colors.php
parent7970c0925505ba1bd3b3dd15a45bebf2e839f5cf (diff)
Revert "remove floIcon: bugs"
This reverts commit 7970c0925505ba1bd3b3dd15a45bebf2e839f5cf.
Diffstat (limited to 'include/colors.php')
-rw-r--r--include/colors.php15
1 files changed, 14 insertions, 1 deletions
diff --git a/include/colors.php b/include/colors.php
index 9e4429a78..1359b9e2d 100644
--- a/include/colors.php
+++ b/include/colors.php
@@ -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;