Changeset 13843 for trunk/admin
- Timestamp:
- Apr 1, 2012, 2:02:36 AM (12 years ago)
- Location:
- trunk/admin/include
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/include/functions_upload.inc.php
r13082 r13843 270 270 } 271 271 272 // we need to save the rotation angle in the database to compute 273 // width/height of "multisizes" 274 $rotation_angle = pwg_image::get_rotation_angle($file_path); 275 $rotation = pwg_image::get_rotation_code_from_angle($rotation_angle); 276 272 277 $file_infos = pwg_image_infos($file_path); 273 278 … … 281 286 'md5sum' => $md5sum, 282 287 'added_by' => $user['id'], 288 'rotation' => $rotation, 283 289 ); 284 290 … … 308 314 'md5sum' => $md5sum, 309 315 'added_by' => $user['id'], 316 'rotation' => $rotation, 310 317 ); 311 318 -
trunk/admin/include/image.class.php
r13736 r13843 239 239 } 240 240 241 $rotation = null;241 $rotation = 0; 242 242 243 243 $exif = exif_read_data($source_filepath); … … 261 261 262 262 return $rotation; 263 } 264 265 static function get_rotation_code_from_angle($rotation_angle) 266 { 267 switch($rotation_angle) 268 { 269 case 0: return 0; 270 case 90: return 1; 271 case 180: return 2; 272 case 270: return 3; 273 } 274 } 275 276 static function get_rotation_angle_from_code($rotation_code) 277 { 278 switch($rotation_code) 279 { 280 case 0: return 0; 281 case 1: return 90; 282 case 2: return 180; 283 case 3: return 270; 284 } 263 285 } 264 286 … … 424 446 { 425 447 $this->image->setInterlaceScheme(Imagick::INTERLACE_LINE); 426 if ($this->get_width()%2 == 0 && $this->get_height()%2 == 0 427 && $this->get_width() > 3*$width) 448 449 // TODO need to explain this condition 450 if ($this->get_width()%2 == 0 451 && $this->get_height()%2 == 0 452 && $this->get_width() > 3*$width) 428 453 { 429 454 $this->image->scaleImage($this->get_width()/2, $this->get_height()/2); 430 455 } 456 431 457 return $this->image->resizeImage($width, $height, Imagick::FILTER_LANCZOS, 0.9); 432 458 }
Note: See TracChangeset
for help on using the changeset viewer.