Changeset 1615

Show
Ignore:
Timestamp:
07/06/08 20:50:47 (5 months ago)
Author:
vollmerk
Message:

add image dimensions on find album art page

Location:
trunk
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • trunk/docs/CHANGELOG

    r1608 r1615  
    55-------------------------------------------------------------------------- 
    66  v.3.5-Alpha1 
     7        - Added Image Dimensions on Find Album Art page 
    78        - Added Confirmation Screen to Catalog Deletion 
    89        - Reorganized Menu System and Added Modules section 
  • trunk/lib/class/core.class.php

    r1608 r1615  
    8888        } // form_verify 
    8989 
     90        /** 
     91        * image_dimensions 
     92        * This returns the dimensions of the passed song of the passed type 
     93        * returns an empty array if PHP-GD is not currently installed, returns 
     94        * false on error 
     95        */  
     96        public static function image_dimensions($image_data) {  
     97 
     98                if (!function_exists('ImageCreateFromString')) { return false; }  
     99 
     100                $image = ImageCreateFromString($image_data);  
     101 
     102                if (!$image) { return false; }  
     103 
     104                $width = imagesx($image);  
     105                $height = imagesy($image);  
     106 
     107                if (!$width || !$height) { return false; }  
     108 
     109                return array('width'=>$width,'heigh'=>$height);  
     110 
     111        } // image_dimensions 
     112 
    90113} // Core 
    91114?> 
  • trunk/lib/class/vainfo.class.php

    r1569 r1615  
    495495        private function _clean_tag($tag,$encoding='') {  
    496496 
     497                return $tag;  
     498 
    497499                // If we've got iconv then go ahead and clear her up             
    498500                if ($this->_iconv) {  
  • trunk/templates/show_album_art.inc.php

    r1518 r1615  
    3434                $key = $i*4+$j; 
    3535                $image_url = Config::get('web_path') . '/image.php?type=session&image_index=' . $key;  
     36                $dimensions = Core::image_dimensions(get_image_from_source($_SESSION['form']['images'][$key]));  
    3637                if (!isset($images[$key])) { echo "<td>&nbsp;</td>\n"; }  
    3738                else {  
    3839?> 
    3940                        <td align="center"> 
    40                                 <a href="<?php echo $image_url; ?>" target="_blank"> 
    41                                 <img src="<?php echo $image_url; ?>" alt="Album Art" border="0" height="175" width="175" /><br /> 
    42                                 </a> 
     41                                <a href="<?php echo $image_url; ?>" target="_blank"><img src="<?php echo $image_url; ?>" alt="Album Art" border="0" height="175" width="175" /></a> 
     42                                <br /> 
    4343                                <p align="center"> 
    44                                 [<a href="<?php echo Config::get('web_path'); ?>/albums.php?action=select_art&amp;image=<?php echo $key; ?>&amp;album_id=<?php echo urlencode($_REQUEST['album_id']); ?>">Select</a>] 
     44                                <?php if (is_array($dimensions)) { ?> 
     45                                [<?php echo intval($dimensions['width']); ?>x<?php echo intval($dimensions['heigh']); ?>]  
     46                                <?php } ?>       
     47                                [<a href="<?php echo Config::get('web_path'); ?>/albums.php?action=select_art&amp;image=<?php echo $key; ?>&amp;album_id=<?php echo intval($_REQUEST['album_id']); ?>">Select</a>] 
    4548                                </p> 
    4649                        </td>