aboutsummaryrefslogtreecommitdiff
path: root/actions
diff options
context:
space:
mode:
authorGreg Froese <greg.froese@gmail.com>2009-05-18 12:57:59 +0000
committerGreg Froese <greg.froese@gmail.com>2009-05-18 12:57:59 +0000
commit70ad5de3a1d4fffc8b3d97c301194bb0258b4c68 (patch)
tree765e5d8b7081fd3373df0fb89d33a237a0239fce /actions
parentdd81b02a85596a913c4a42fba655766b61334eb1 (diff)
downloadelgg-70ad5de3a1d4fffc8b3d97c301194bb0258b4c68.tar.gz
elgg-70ad5de3a1d4fffc8b3d97c301194bb0258b4c68.tar.bz2
fixed watermarking after code re-org and added most recently viewed option
Diffstat (limited to 'actions')
-rw-r--r--actions/upload.php11
1 files changed, 6 insertions, 5 deletions
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 );
}