diff options
-rw-r--r-- | actions/upload.php | 4 | ||||
-rw-r--r-- | 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 @@ <?php function tp_watermark($thumbs) { + include_once dirname(__FILE__) . "/tidypics.php"; + global $CONFIG; $user = get_user_entity_as_row($album->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(); |