[ Index ] |
|
Code source de LifeType 1.2.4 |
1 <?php 2 3 4 5 /** 6 * \ingroup Gallery_resizer 7 * 8 * Abstract class for generating thumbnails. It actually provides no methods but only 9 * the skeleton of the functions that should be implemented by the generators 10 * themselves. 11 */ 12 class GalleryAbstractResizer 13 { 14 15 var $_image; 16 var $_outputMethod; 17 var $_keepAspectRatio; 18 19 /** 20 * Constructor. 21 * 22 */ 23 function GalleryAbstractResizer( $image, $outputMethod ) 24 { 25 $this->_image = $image; 26 $this->_outputMethod = $outputMethod; 27 $this->_keepAspectRatio = true; 28 } 29 30 /** 31 * Informs the resizer to keep the aspect ratio of the image when resizing, although 32 * this value may be ignored by the resizer and it depends on the implementation. 33 * 34 * @param keepAspectRatio Whether to keep the aspect ratio 35 */ 36 function setKeepAspectRatio( $keepAspectRatio ) 37 { 38 $this->_keepAspectRatio = $keepAspectRatio; 39 } 40 41 /** 42 * Generates the thumbnail 43 * Uses the values set in the constructor regarding the width, height and output format 44 * 45 * @return Returns a the path to the thumbnail that was generated, or empty if error 46 * @see GalleryResizer::generate() 47 */ 48 function generate( $outFile, $width, $height ) 49 { 50 throw( new Exception( "This function can't be called and must be implemented by child classes!" )); 51 die(); 52 } 53 } 54 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Mon Nov 26 21:04:15 2007 | par Balluche grâce à PHPXref 0.7 |
![]() |