diff options
author | Greg Froese <greg.froese@gmail.com> | 2009-05-12 14:34:13 +0000 |
---|---|---|
committer | Greg Froese <greg.froese@gmail.com> | 2009-05-12 14:34:13 +0000 |
commit | 30b3d62f17b48cbc4ce0e9322bb2e1d282a3afcb (patch) | |
tree | c3accd3dcbea7c510534312a70abaadf6e7dfa4b /actions/upload.php | |
parent | 36dbbe5be6781b3816283a35054067c99bb5cc10 (diff) | |
download | elgg-30b3d62f17b48cbc4ce0e9322bb2e1d282a3afcb.tar.gz elgg-30b3d62f17b48cbc4ce0e9322bb2e1d282a3afcb.tar.bz2 |
tweak to watermark file creation
Diffstat (limited to 'actions/upload.php')
-rw-r--r-- | actions/upload.php | 7 |
1 files changed, 6 insertions, 1 deletions
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;
|