From 2d62be1359e75514157740a308aef696e485a1ee Mon Sep 17 00:00:00 2001 From: Karl 'vollmerk' Vollmer Date: Mon, 7 Jul 2008 03:50:47 +0000 Subject: add image dimensions on find album art page --- lib/class/core.class.php | 23 +++++++++++++++++++++++ lib/class/vainfo.class.php | 2 ++ 2 files changed, 25 insertions(+) (limited to 'lib') 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 ?> diff --git a/lib/class/vainfo.class.php b/lib/class/vainfo.class.php index 5ecfda43..ee2ce147 100644 --- a/lib/class/vainfo.class.php +++ b/lib/class/vainfo.class.php @@ -494,6 +494,8 @@ class vainfo { */ private function _clean_tag($tag,$encoding='') { + return $tag; + // If we've got iconv then go ahead and clear her up if ($this->_iconv) { /* Guess that it's UTF-8 */ -- cgit