diff options
-rwxr-xr-x | docs/CHANGELOG | 1 | ||||
-rw-r--r-- | lib/class/core.class.php | 23 | ||||
-rw-r--r-- | lib/class/vainfo.class.php | 2 | ||||
-rw-r--r-- | 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 "<td> </td>\n"; } else { ?> <td align="center"> - <a href="<?php echo $image_url; ?>" target="_blank"> - <img src="<?php echo $image_url; ?>" alt="Album Art" border="0" height="175" width="175" /><br /> - </a> + <a href="<?php echo $image_url; ?>" target="_blank"><img src="<?php echo $image_url; ?>" alt="Album Art" border="0" height="175" width="175" /></a> + <br /> <p align="center"> - [<a href="<?php echo Config::get('web_path'); ?>/albums.php?action=select_art&image=<?php echo $key; ?>&album_id=<?php echo urlencode($_REQUEST['album_id']); ?>">Select</a>] + <?php if (is_array($dimensions)) { ?> + [<?php echo intval($dimensions['width']); ?>x<?php echo intval($dimensions['heigh']); ?>] + <?php } ?> + [<a href="<?php echo Config::get('web_path'); ?>/albums.php?action=select_art&image=<?php echo $key; ?>&album_id=<?php echo intval($_REQUEST['album_id']); ?>">Select</a>] </p> </td> <?php |