Changeset 10684
- Timestamp:
- Apr 29, 2011, 7:10:00 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/include/image.class.php
r10641 r10684 58 58 function __construct($source_filepath, $library=null) 59 59 { 60 global $conf;61 62 60 $this->source_filepath = $source_filepath; 63 61 … … 76 74 } 77 75 78 if (is_null($library)) 79 { 80 $library = $conf['image_library']; 81 } 82 83 // Choose image library 84 switch (strtolower($library)) 85 { 86 case 'auto': 87 case 'imagick': 88 if ($extension != 'gif' and self::is_imagick()) 89 { 90 $this->library = 'imagick'; 91 break; 92 } 93 case 'ext_imagick': 94 if ($extension != 'gif' and self::is_ext_imagick()) 95 { 96 $this->library = 'ext_imagick'; 97 break; 98 } 99 case 'gd': 100 if (self::is_gd()) 101 { 102 $this->library = 'gd'; 103 break; 104 } 105 default: 106 if ($library != 'auto') 107 { 108 // Requested library not available. Try another library 109 return self::__construct($source_filepath, 'auto'); 110 } 111 die('No image library available on your server.'); 76 if (!($this->library = self::get_library($library, $extension))) 77 { 78 die('No image library available on your server.'); 112 79 } 113 80 … … 305 272 return false; 306 273 } 307 @exec($conf['ext_imagick_dir'].'convert ', $returnarray, $returnvalue);274 @exec($conf['ext_imagick_dir'].'convert -version', $returnarray, $returnvalue); 308 275 if (!$returnvalue and !empty($returnarray[0]) and preg_match('/ImageMagick/i', $returnarray[0])) 309 276 { … … 316 283 { 317 284 return function_exists('gd_info'); 285 } 286 287 static function get_library($library=null, $extension=null) 288 { 289 global $conf; 290 291 if (is_null($library)) 292 { 293 $library = $conf['image_library']; 294 } 295 296 // Choose image library 297 switch (strtolower($library)) 298 { 299 case 'auto': 300 case 'imagick': 301 if ($extension != 'gif' and self::is_imagick()) 302 { 303 return 'imagick'; 304 } 305 case 'ext_imagick': 306 if ($extension != 'gif' and self::is_ext_imagick()) 307 { 308 return 'ext_imagick'; 309 } 310 case 'gd': 311 if (self::is_gd()) 312 { 313 return 'gd'; 314 } 315 default: 316 if ($library != 'auto') 317 { 318 // Requested library not available. Try another library 319 return self::get_library('auto'); 320 } 321 } 322 return false; 318 323 } 319 324 -
trunk/admin/intro.php
r8728 r10684 30 30 include_once(PHPWG_ROOT_PATH.'admin/include/check_integrity.class.php'); 31 31 include_once(PHPWG_ROOT_PATH.'admin/include/c13y_internal.class.php'); 32 include_once(PHPWG_ROOT_PATH.'admin/include/image.class.php'); 32 33 33 34 // +-----------------------------------------------------------------------+ … … 259 260 } 260 261 262 // graphics library 263 switch (pwg_image::get_library()) 264 { 265 case 'imagick': 266 $library = 'ImageMagick'; 267 $img = new Imagick(); 268 $version = $img->getVersion(); 269 if (preg_match('/ImageMagick \d+\.\d+\.\d+-?\d*/', $version['versionString'], $match)) 270 { 271 $library = $match[0]; 272 } 273 $template->assign('GRAPHICS_LIBRARY', $library); 274 break; 275 276 case 'ext_imagick': 277 $library = 'External ImageMagick'; 278 exec($conf['ext_imagick_dir'].'convert -version', $returnarray); 279 if (preg_match('/Version: ImageMagick (\d+\.\d+\.\d+-?\d*)/', $returnarray[0], $match)) 280 { 281 $library .= ' ' . $match[1]; 282 } 283 $template->assign('GRAPHICS_LIBRARY', $library); 284 break; 285 286 case 'gd': 287 $gd_info = gd_info(); 288 $template->assign('GRAPHICS_LIBRARY', 'GD '.@$gd_info['GD Version']); 289 break; 290 } 291 261 292 // +-----------------------------------------------------------------------+ 262 293 // | sending html code | -
trunk/admin/photos_add_settings.php
r10641 r10684 112 112 array( 113 113 'F_ADD_ACTION'=> PHOTOS_ADD_BASE_URL, 114 'MANAGE_HD' => (pwg_image::is_imagick() or pwg_image::is_ext_imagick()),114 'MANAGE_HD' => pwg_image::get_library() != 'gd', 115 115 'values' => $form_values 116 116 ) -
trunk/admin/themes/default/template/intro.tpl
r10538 r10684 54 54 <li>PHP: {$PHP_VERSION} (<a href="{$U_PHPINFO}" class="externalLink">{'Show info'|@translate}</a>) [{$PHP_DATATIME}]</li> 55 55 <li>{$DB_ENGINE}: {$DB_VERSION} [{$DB_DATATIME}]</li> 56 {if isset($GRAPHICS_LIBRARY)} 57 <li>{'Graphics Library'|@translate}: {$GRAPHICS_LIBRARY}</li> 58 {/if} 56 59 </ul> 57 60 </dd> -
trunk/language/en_UK/admin.lang.php
r10571 r10684 831 831 $lang['Follow Orientation'] = 'Follow Orientation'; 832 832 $lang['If you want to regenerate thumbnails, please go to the <a href="%s">Batch Manager</a>.'] = 'If you want to regenerate thumbnails, please go to the <a href="%s">Batch Manager</a>.'; 833 $lang['Graphics Library'] = 'Graphics Library'; 833 834 ?> -
trunk/language/fr_FR/admin.lang.php
r10571 r10684 842 842 $lang['Follow Orientation'] = "Respecter l'orientation"; 843 843 $lang['If you want to regenerate thumbnails, please go to the <a href="%s">Batch Manager</a>.'] = 'Si vous voulez régénérer des miniatures, merci de vous rendre dans la <a href="%s">Gestion par lot</a>.'; 844 $lang['Graphics Library'] = 'Bibliothèque graphique'; 844 845 ?> -
trunk/ws.php
r10641 r10684 413 413 'type' => array('default' => 'thumbnail'), 414 414 'automatic_rotation' => array('default' => $conf['upload_form_automatic_rotation']), 415 'library' => array('default' => $conf[' image_library']),415 'library' => array('default' => $conf['graphics_library']), 416 416 'maxwidth' => array('default' => null), 417 417 'maxheight' => array('default' => null),
Note: See TracChangeset
for help on using the changeset viewer.