]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
not leaving behind temp image from watermark and shortened watermark image name
authorCash Costello <cash.costello@gmail.com>
Sun, 12 Jul 2009 00:28:20 +0000 (00:28 +0000)
committerCash Costello <cash.costello@gmail.com>
Sun, 12 Jul 2009 00:28:20 +0000 (00:28 +0000)
lib/watermark.php

index 095b10eac607269522d615819044145a8e1bf092..25eb52d481d4a8a35df1fe0bfb8ebe88d189d78e 100644 (file)
@@ -28,7 +28,6 @@ function tp_watermark($thumbs) {
                        
                        $user_stamp_base = tp_get_img_dir();
                        $user_stamp_base .= strtolower($viewer->name . "_" . $watermark_filename . "_stamp");
-                       $user_stamp_base .= preg_replace("/[^\w-]+/", "-", $user_stamp_base);
                        
                        if( !file_exists( $user_stamp_base . $ext )) { //create the watermark if it doesn't exist
                                $commands = array();
@@ -37,7 +36,7 @@ function tp_watermark($thumbs) {
                                $commands[] = $im_path . 'composite -compose CopyOpacity  "' . $user_stamp_base . "_mask" . $ext . '" "' . $user_stamp_base . '_fgnd' . $ext . '" "' . $user_stamp_base . $ext . '"';
                                $commands[] = $im_path . 'mogrify -trim +repage "' . $user_stamp_base . $ext . '"';
                                $commands[] = 'rm "' . $user_stamp_base . '_mask' . $ext . '"';
-                               $commands[] = 'rm "' . $user_stamp_fgnd . '_mask' . $ext . '"';
+                               $commands[] = 'rm "' . $user_stamp_base . '_fgnd' . $ext . '"';
                                
                                foreach( $commands as $command ) {
                                        exec( $command );