summaryrefslogtreecommitdiffstats
path: root/lib/class/core.class.php
diff options
context:
space:
mode:
authorKarl 'vollmerk' Vollmer <vollmer@ampache.org>2008-07-07 03:50:47 +0000
committerKarl 'vollmerk' Vollmer <vollmer@ampache.org>2008-07-07 03:50:47 +0000
commit2d62be1359e75514157740a308aef696e485a1ee (patch)
treebab58fd6fafb4c3220d1713da5fd8e5c43ef8c36 /lib/class/core.class.php
parent1d7e7cfb5be9c65cc18d30926e2d2d9dd6747fbc (diff)
downloadampache-2d62be1359e75514157740a308aef696e485a1ee.tar.gz
ampache-2d62be1359e75514157740a308aef696e485a1ee.tar.bz2
ampache-2d62be1359e75514157740a308aef696e485a1ee.zip
add image dimensions on find album art page
Diffstat (limited to 'lib/class/core.class.php')
-rw-r--r--lib/class/core.class.php23
1 files changed, 23 insertions, 0 deletions
diff --git a/lib/class/core.class.php b/lib/class/core.class.php
index 4818e39b..c1d07e86 100644
--- a/lib/class/core.class.php
+++ b/lib/class/core.class.php
@@ -87,5 +87,28 @@ class Core {
} // form_verify
+ /**
+ * image_dimensions
+ * This returns the dimensions of the passed song of the passed type
+ * returns an empty array if PHP-GD is not currently installed, returns
+ * false on error
+ */
+ public static function image_dimensions($image_data) {
+
+ if (!function_exists('ImageCreateFromString')) { return false; }
+
+ $image = ImageCreateFromString($image_data);
+
+ if (!$image) { return false; }
+
+ $width = imagesx($image);
+ $height = imagesy($image);
+
+ if (!$width || !$height) { return false; }
+
+ return array('width'=>$width,'heigh'=>$height);
+
+ } // image_dimensions
+
} // Core
?>