From 47a49c851ab285e7e4f48aa29247a8a71fdb9d5c Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Sun, 17 May 2009 17:45:58 +0000 Subject: moved all resize code into lib/resize.php --- actions/upload.php | 50 ++------------------------------------------------ 1 file changed, 2 insertions(+), 48 deletions(-) (limited to 'actions/upload.php') diff --git a/actions/upload.php b/actions/upload.php index ecdeb27f7..7c50b95d4 100644 --- a/actions/upload.php +++ b/actions/upload.php @@ -6,7 +6,6 @@ */ global $CONFIG; - include dirname(__FILE__) . "/resize.php"; include dirname(dirname(__FILE__)) . "/lib/resize.php"; // Get common variables @@ -138,60 +137,15 @@ */ } else { // ImageMagick command line -/* + if (tp_create_imagick_cmdline_thumbnails($file, $prefix, $filestorename) != true) { trigger_error('Tidypics warning: failed to create thumbnails', E_USER_WARNING); } -*/ - //gfroese: build the actual thumbnails now $album = get_entity($container_guid); $user = get_user_entity_as_row($album->owner_guid); $username = $user->username; - - try { - $thumblarge = tp_resize($file->getFilenameOnFilestore(), - "largethumb", - $CONFIG->tidypics->image_large_width, - $CONFIG->tidypics->image_large_height, - false); - } catch (Exception $e) { $thumblarge = false; } - try { - $thumbsmall = tp_resize($file->getFilenameOnFilestore(), - "smallthumb", - $CONFIG->tidypics->image_small_width, - $CONFIG->tidypics->image_small_height, - true); - } catch (Exception $e) { $thumbsmall = false; } - try { - $thumbnail = tp_resize($file->getFilenameOnFilestore(), - "thumb", - $CONFIG->tidypics->image_thumb_width, - $CONFIG->tidypics->image_thumb_height, - true); - } catch (Exception $e) { $thumbnail = false; } - - if ($thumbnail) { - $thumb = new ElggFile(); - $thumb->setMimeType($mime); - $thumb->setFilename($prefix."thumb".$filestorename); - $file->thumbnail = $prefix."thumb".$filestorename; - } - - if ($thumbsmall) { - $thumb = new ElggFile(); - $thumb->setMimeType($mime); - $thumb->setFilename($prefix."smallthumb".$filestorename); - $file->smallthumb = $prefix."smallthumb".$filestorename; - } - - if ($thumblarge) { - $thumb = new ElggFile(); - $thumb->setMimeType($mime); - $thumb->setFilename($prefix."largethumb".$filestorename); - $file->largethumb = $prefix."largethumb".$filestorename; - } - + $im_path = get_plugin_setting('convert_command', 'tidypics'); if(!$im_path) { $im_path = "/usr/bin/"; -- cgit v1.2.3