From 30b3d62f17b48cbc4ce0e9322bb2e1d282a3afcb Mon Sep 17 00:00:00 2001 From: Greg Froese Date: Tue, 12 May 2009 14:34:13 +0000 Subject: tweak to watermark file creation --- actions/upload.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/actions/upload.php b/actions/upload.php index 797a4dfce..2f84a9f6b 100644 --- a/actions/upload.php +++ b/actions/upload.php @@ -161,7 +161,12 @@ if( $watermark_text ) { //get this value from the plugin settings if( $thumblarge ) { $ext = ".png"; - $user_stamp_base = dirname(__FILE__) . "/" . $username . "_stamp"; + + $watermark_filename = strtolower($watermark_text); + $watermark_filename = preg_replace("/[^\w-]+/", "-", $watermark_filename); + $watermark_filename = trim($watermark_filename, '-'); + + $user_stamp_base = dirname(__FILE__) . "/" . $username . "_" . $watermark_filename . "_stamp"; if( !file_exists( $user_stamp_base . $ext )) { //create the watermark if it doesn't exist $commands = array(); $commands[] = 'convert -size 300x50 xc:grey30 -pointsize 20 -gravity center -draw "fill grey70 text 0,0 \''. $watermark_text . '\'" '. $user_stamp_base . '_fgnd' . $ext; -- cgit v1.2.3