From d723ef3f6e5ba2567cb494943ba6aaeaac6c7e22 Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Sun, 21 Jun 2009 23:03:23 +0000 Subject: better job catching no settings --- actions/upload.php | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) (limited to 'actions/upload.php') diff --git a/actions/upload.php b/actions/upload.php index 65005671a..f062edc80 100644 --- a/actions/upload.php +++ b/actions/upload.php @@ -30,7 +30,7 @@ $image_lib = get_plugin_setting('image_lib', 'tidypics'); if (!$image_lib) - $image_lib = 'GD'; + $image_lib = "GD"; // post limit exceeded if (count($_FILES) == 0) { @@ -153,29 +153,30 @@ } - if ($image_lib == 'GD') { - - if (tp_create_gd_thumbnails($file, $prefix, $filestorename) != true) { - trigger_error('Tidypics warning: failed to create thumbnails', E_USER_WARNING); - } + if ($image_lib == 'ImageMagick') { // ImageMagick command line - } else if ($image_lib == 'ImageMagickPHP') { // ImageMagick PHP - - if (tp_create_imagick_thumbnails($file, $prefix, $filestorename) != true) { - trigger_error('Tidypics warning: failed to create thumbnails', E_USER_WARNING); - } - - } else { // ImageMagick command line - $thumbs = tp_create_imagick_cmdline_thumbnails($file, $prefix, $filestorename); if(!count($thumbs)) { - trigger_error('Tidypics warning: failed to create thumbnails', E_USER_WARNING); + trigger_error('Tidypics warning: failed to create thumbnails - ImageMagick command line', E_USER_WARNING); } - + $album = get_entity($container_guid); tp_watermark($thumbs); + + } else if ($image_lib == 'ImageMagickPHP') { // ImageMagick PHP + + if (tp_create_imagick_thumbnails($file, $prefix, $filestorename) != true) { + trigger_error('Tidypics warning: failed to create thumbnails - ImageMagick PHP', E_USER_WARNING); + } + + } else { + + if (tp_create_gd_thumbnails($file, $prefix, $filestorename) != true) { + trigger_error('Tidypics warning: failed to create thumbnails - GD', E_USER_WARNING); + } + } // end of image library selector //keep one file handy so we can add a notice to the river if single image option selected -- cgit v1.2.3