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 --- docs/CHANGELOG | 1 + lib/class/core.class.php | 23 +++++++++++++++++++++++ lib/class/vainfo.class.php | 2 ++ templates/show_album_art.inc.php | 11 +++++++---- 4 files changed, 33 insertions(+), 4 deletions(-) diff --git a/docs/CHANGELOG b/docs/CHANGELOG index 4b5d9a06..2836d2b7 100755 --- a/docs/CHANGELOG +++ b/docs/CHANGELOG @@ -4,6 +4,7 @@ -------------------------------------------------------------------------- v.3.5-Alpha1 + - Added Image Dimensions on Find Album Art page - Added Confirmation Screen to Catalog Deletion - Reorganized Menu System and Added Modules section - Fix an error if you try to add a shoutbox for an invalid object 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 */ diff --git a/templates/show_album_art.inc.php b/templates/show_album_art.inc.php index 7e7226bf..71148b88 100644 --- a/templates/show_album_art.inc.php +++ b/templates/show_album_art.inc.php @@ -33,15 +33,18 @@ while ($i <= $rows) { while ($j < 4) { $key = $i*4+$j; $image_url = Config::get('web_path') . '/image.php?type=session&image_index=' . $key; + $dimensions = Core::image_dimensions(get_image_from_source($_SESSION['form']['images'][$key])); if (!isset($images[$key])) { echo " \n"; } else { ?> - - Album Art
-
+ Album Art +

- [Select] + + [x] + + [Select]