From 70ad5de3a1d4fffc8b3d97c301194bb0258b4c68 Mon Sep 17 00:00:00 2001 From: Greg Froese Date: Mon, 18 May 2009 12:57:59 +0000 Subject: fixed watermarking after code re-org and added most recently viewed option --- actions/upload.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'actions') diff --git a/actions/upload.php b/actions/upload.php index 7aa87dc2b..1657210ed 100644 --- a/actions/upload.php +++ b/actions/upload.php @@ -144,8 +144,8 @@ */ } else { // ImageMagick command line - - if (tp_create_imagick_cmdline_thumbnails($file, $prefix, $filestorename) != true) { + $thumbs = tp_create_imagick_cmdline_thumbnails($file, $prefix, $filestorename); + if(!count($thumbs)) { trigger_error('Tidypics warning: failed to create thumbnails', E_USER_WARNING); } @@ -163,8 +163,9 @@ $watermark_text = get_plugin_setting('watermark_text', 'tidypics'); $watermark_text = str_replace("%username%", $viewer->username, $watermark_text); $watermark_text = str_replace("%sitename%", $CONFIG->sitename, $watermark_text); + if( $watermark_text ) { //get this value from the plugin settings - if( $thumblarge ) { + if( $thumbs["thumblarge"] ) { $ext = ".png"; $watermark_filename = strtolower($watermark_text); @@ -190,8 +191,8 @@ } //apply the watermark $commands = array(); - $commands[] = $im_path . 'composite -gravity south -geometry +0+10 "' . $user_stamp_base . $ext . '" "' . $thumblarge . '" "' . $thumblarge . '_watermarked"'; - $commands[] = "mv \"$thumblarge" . "_watermarked\" \"$thumblarge\""; + $commands[] = $im_path . 'composite -gravity south -geometry +0+10 "' . $user_stamp_base . $ext . '" "' . $thumbs["thumblarge"] . '" "' . $thumbs["thumblarge"] . '_watermarked"'; + $commands[] = "mv \"$thumbs[thumblarge]" . "_watermarked\" \"$thumbs[thumblarge]\""; foreach( $commands as $command ) { exec( $command ); } -- cgit v1.2.3