Changeset 6616
- Timestamp:
- Jun 28, 2010, 10:57:35 PM (14 years ago)
- Location:
- branches/2.1/admin
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.1/admin/include/functions_upload.inc.php
r6499 r6616 43 43 $random_string = substr($md5sum, 0, 8); 44 44 $filename_wo_ext = $date_string.'-'.$random_string; 45 $file_path = $upload_dir.'/'.$filename_wo_ext.'.jpg'; 45 $file_path = $upload_dir.'/'.$filename_wo_ext.'.'; 46 47 list($width, $height, $type) = getimagesize($source_filepath); 48 if (IMAGETYPE_PNG == $type) 49 { 50 $file_path.= 'png'; 51 } 52 else 53 { 54 $file_path.= 'jpg'; 55 } 46 56 47 57 prepare_directory($upload_dir); … … 199 209 if (in_array($extension, array('jpg', 'jpeg'))) 200 210 { 201 $source_image = @imagecreatefromjpeg($source_filepath);211 $source_image = imagecreatefromjpeg($source_filepath); 202 212 } 203 213 else if ($extension == 'png') 204 214 { 205 $source_image = @imagecreatefrompng($source_filepath);215 $source_image = imagecreatefrompng($source_filepath); 206 216 } 207 217 else … … 253 263 ); 254 264 255 imagejpeg($destination_image, $destination_filepath, $quality); 265 $extension = strtolower(get_extension($destination_filepath)); 266 if ($extension == 'png') 267 { 268 imagepng($destination_image, $destination_filepath); 269 } 270 else 271 { 272 imagejpeg($destination_image, $destination_filepath, $quality); 273 } 256 274 // freeing memory ressources 257 275 imagedestroy($source_image); -
branches/2.1/admin/themes/default/template/photos_add_direct.tpl
r6364 r6616 107 107 'buttonText' : buttonText, 108 108 'multi' : true, 109 'fileDesc' : 'Photo files (*.jpg,*.jpeg )',110 'fileExt' : '*.jpg;*.JPG;*.jpeg;*.JPEG ',109 'fileDesc' : 'Photo files (*.jpg,*.jpeg,*.png)', 110 'fileExt' : '*.jpg;*.JPG;*.jpeg;*.JPEG;*.png;*.PNG', 111 111 'onAllComplete' : function(event, data) { 112 112 if (data.errors) {
Note: See TracChangeset
for help on using the changeset viewer.