Changeset 9953 for extensions/square_thumbnails
- Timestamp:
- Mar 31, 2011, 5:30:43 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/square_thumbnails/trunk/functions.inc.php
r9773 r9953 141 141 } 142 142 143 if (is_imagick()) 143 $extension = strtolower(get_extension($source_filepath)); 144 145 if (is_imagick() and $extension != 'gif') 144 146 { 145 147 return upload_square_resize_im($source_filepath, $destination_filepath, $max_width, $max_height, $quality, $strip_metadata); … … 157 159 return false; 158 160 } 161 162 $gd_info = gd_info(); 159 163 160 164 // extension of the picture filename … … 170 174 $source_image = @imagecreatefrompng($source_filepath); 171 175 } 172 else 173 { 174 die('unsupported file extension'); 176 elseif ($extension == 'gif' and $gd_info['GIF Read Support'] and $gd_info['GIF Create Support']) 177 { 178 $source_image = @imagecreatefromgif($source_filepath); 179 } 180 else 181 { 182 die('[GD] unsupported file extension'); 175 183 } 176 184 … … 224 232 imagepng($destination_image, $destination_filepath); 225 233 } 234 elseif ($extension == 'gif') 235 { 236 imagegif($destination_image, $destination_filepath); 237 } 226 238 else 227 239 { … … 303 315 $conf['thumbnails_ratio_orientation'] = true; 304 316 305 if (!$conf['thumbnails_ratio_orientation'] and $rotation)306 $conf['thumbnails_ratio_orientation'] = true;307 308 317 $x = 0; 309 318 $y = 0; 310 319 311 if ($source_width >= $source_height or !$conf['thumbnails_ratio_orientation']) 320 if (!$conf['thumbnails_ratio_orientation'] and in_array($rotation, array(90, 270))) 321 list($heightRatio, $widthRatio) = explode(':', $conf['thumbnails_ratio']); 322 323 elseif ($source_width >= $source_height or !$conf['thumbnails_ratio_orientation']) 312 324 list($widthRatio, $heightRatio) = explode(':', $conf['thumbnails_ratio']); 325 313 326 else 314 327 list($heightRatio, $widthRatio) = explode(':', $conf['thumbnails_ratio']);
Note: See TracChangeset
for help on using the changeset viewer.