From 63b91d8aee8e40497d865591d16ee1716e0c9c15 Mon Sep 17 00:00:00 2001 From: Greg Froese Date: Wed, 20 May 2009 03:56:56 +0000 Subject: put watermark masks in proper place --- actions/upload.php | 4 ++-- lib/watermark.php | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/actions/upload.php b/actions/upload.php index d9129aef7..dd50d2381 100644 --- a/actions/upload.php +++ b/actions/upload.php @@ -6,8 +6,8 @@ */ global $CONFIG; - include dirname(dirname(__FILE__)) . "/lib/resize.php"; - include dirname(dirname(__FILE__)) . "/lib/watermark.php"; + include_once dirname(dirname(__FILE__)) . "/lib/resize.php"; + include_once dirname(dirname(__FILE__)) . "/lib/watermark.php"; // Get common variables $access_id = (int) get_input("access_id"); diff --git a/lib/watermark.php b/lib/watermark.php index 773aed565..813e298a7 100644 --- a/lib/watermark.php +++ b/lib/watermark.php @@ -1,6 +1,8 @@ owner_guid); @@ -25,9 +27,8 @@ function tp_watermark($thumbs) { $watermark_filename = preg_replace("/[^\w-]+/", "-", $watermark_filename); $watermark_filename = trim($watermark_filename, '-'); - $user_stamp_base = strtolower(dirname(__FILE__) . "/" . $viewer->name . "_" . $watermark_filename . "_stamp"); - $user_stamp_base = preg_replace("/[^\w-]+/", "-", $user_stamp_base); - $user_stamp_base = trim($user_stamp_base, '-'); + $user_stamp_base = tp_get_img_dir(); + $user_stamp_base .= strtolower($viewer->name . "_" . $watermark_filename . "_stamp"); if( !file_exists( $user_stamp_base . $ext )) { //create the watermark if it doesn't exist $commands = array(); -- cgit v1.2.3