aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--actions/upload.php33
-rw-r--r--lib/resize.php1
2 files changed, 18 insertions, 16 deletions
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
diff --git a/lib/resize.php b/lib/resize.php
index 7c06b28c5..8561e1f4a 100644
--- a/lib/resize.php
+++ b/lib/resize.php
@@ -20,6 +20,7 @@
$image_sizes = get_plugin_setting('image_sizes', 'tidypics');
if (!$image_sizes) {
register_error(elgg_echo('tidypics:nosettings'));
+ forward($_SERVER['HTTP_REFERER']);
return false;
}
$image_sizes = unserialize($image_sizes);