Changeset 9952 for trunk/admin/include
- Timestamp:
- Mar 31, 2011, 4:26:16 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/include/functions_upload.inc.php
r9844 r9952 239 239 { 240 240 $file_path.= 'png'; 241 } 242 elseif (IMAGETYPE_GIF == $type) 243 { 244 $file_path.= 'gif'; 241 245 } 242 246 else … … 479 483 $ratio_width = $width / $max_width; 480 484 $ratio_height = $height / $max_height; 485 $destination_width = $width; 486 $destination_height = $height; 481 487 482 488 // maximal size exceeded ? … … 514 520 } 515 521 516 if (is_imagick()) 522 $extension = strtolower(get_extension($source_filepath)); 523 524 if (is_imagick() and $extension != 'gif') 517 525 { 518 526 return pwg_image_resize_im($source_filepath, $destination_filepath, $max_width, $max_height, $quality, $strip_metadata); … … 530 538 return false; 531 539 } 540 541 $gd_info = gd_info(); 532 542 533 543 // extension of the picture filename … … 543 553 $source_image = imagecreatefrompng($source_filepath); 544 554 } 555 elseif ($extension == 'gif' and $gd_info['GIF Read Support'] and $gd_info['GIF Create Support']) 556 { 557 $source_image = imagecreatefromgif($source_filepath); 558 } 545 559 else 546 560 { 547 die(' unsupported file extension');561 die('[GD] unsupported file extension'); 548 562 } 549 563 … … 595 609 imagepng($destination_image, $destination_filepath); 596 610 } 611 elseif ($extension == 'gif') 612 { 613 imagegif($destination_image, $destination_filepath); 614 } 597 615 else 598 616 { … … 665 683 666 684 if (!$conf['upload_form_automatic_rotation']) 685 { 686 return null; 687 } 688 689 list($width, $height, $type) = getimagesize($source_filepath); 690 if (IMAGETYPE_JPEG != $type) 667 691 { 668 692 return null; … … 712 736 function is_valid_image_extension($extension) 713 737 { 714 return in_array(strtolower($extension), array('jpg', 'jpeg', 'png' ));738 return in_array(strtolower($extension), array('jpg', 'jpeg', 'png', 'gif')); 715 739 } 716 740
Note: See TracChangeset
for help on using the changeset viewer.