Changeset 25929 for trunk/admin/include
- Timestamp:
- Dec 12, 2013, 11:34:55 AM (11 years ago)
- Location:
- trunk/admin/include
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/include/functions_upload.inc.php
r25018 r25929 172 172 173 173 $file_path = null; 174 $is_tiff = false; 174 175 175 176 if (isset($image_id)) … … 227 228 $file_path.= 'gif'; 228 229 } 230 elseif (IMAGETYPE_TIFF_MM == $type or IMAGETYPE_TIFF_II == $type) 231 { 232 $is_tiff = true; 233 $file_path.= 'tif'; 234 } 229 235 else 230 236 { … … 244 250 } 245 251 @chmod($file_path, 0644); 252 253 if ($is_tiff and pwg_image::get_library() == 'ext_imagick') 254 { 255 // move the uploaded file to pwg_representative sub-directory 256 $representative_file_path = dirname($file_path).'/pwg_representative/'; 257 $representative_file_path.= get_filename_wo_extension(basename($file_path)).'.'; 258 259 $representative_ext = $conf['tiff_representative_ext']; 260 $representative_file_path.= $representative_ext; 261 262 prepare_directory(dirname($representative_file_path)); 263 264 $exec = $conf['ext_imagick_dir'].'convert'; 265 266 if ('jpg' == $conf['tiff_representative_ext']) 267 { 268 $exec .= ' -quality 98'; 269 } 270 271 $exec .= ' "'.realpath($file_path).'"'; 272 273 $dest = pathinfo($representative_file_path); 274 $exec .= ' "'.realpath($dest['dirname']).'/'.$dest['basename'].'"'; 275 276 $exec .= ' 2>&1'; 277 @exec($exec, $returnarray); 278 279 // sometimes ImageMagick creates file-0.jpg (full size) + file-1.jpg 280 // (thumbnail). I don't know how to avoid it. 281 $representative_file_abspath = realpath($dest['dirname']).'/'.$dest['basename']; 282 if (!file_exists($representative_file_abspath)) 283 { 284 $first_file_abspath = preg_replace( 285 '/\.'.$representative_ext.'$/', 286 '-0.'.$representative_ext, 287 $representative_file_abspath 288 ); 289 290 if (file_exists($first_file_abspath)) 291 { 292 rename($first_file_abspath, $representative_file_abspath); 293 } 294 } 295 } 246 296 247 297 if (pwg_image::get_library() != 'gd') … … 319 369 { 320 370 $insert['level'] = $level; 371 } 372 373 if (isset($representative_ext)) 374 { 375 $insert['representative_ext'] = $representative_ext; 321 376 } 322 377 -
trunk/admin/include/photos_add_direct_prepare.inc.php
r25593 r25929 145 145 146 146 $upload_file_types = 'jpeg, png, gif'; 147 148 if (pwg_image::get_library() == 'ext_imagick') 149 { 150 $upload_file_types.= ', tiff'; 151 $template->assign('tif_enabled', true); 152 } 153 147 154 if ('html' == $upload_mode) 148 155 {
Note: See TracChangeset
for help on using the changeset viewer.