forum.coppermine-gallery.net

No Support => Modifications/Add-Ons/Hacks => Mods: Watermarking & image manipulation => Topic started by: Stramm on March 31, 2006, 03:33:15 pm

Title: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: Stramm on March 31, 2006, 03:33:15 pm
What this mod does
a) it will watermark fullsized and intermediate images (you can set the one or other or both in config)
b) you can turn watermarking on/ off
c) creates a backup of the images (so you can undo watermarking)
d) works with ImageMagick and GD2
e) permanent watermark - puts no extra heat on the server (only when uploading images)
f) several tarnsparency options
g) better admin tools
h) no hardcoded language (supports language files) - added english... so you'll have to switch to english in order to do the config settings (or translate to your lang)

You'll find new entries in coppermine config (Image watermarking)
If you do not enable watermarking here nothing will change compared to an unmodded coppermine (as it should). But as soon as you turn watermarking on, a backup will be created from all new uploaded images and a watermark applied to the intermediate image, the fullsized one or both (depending on your config settings). If you want old images to get the watermark too, then you have to run the admin tools. To make it more comfortable for you I've added an 'auto refresh' feature.
When you're recreating thumbs/ images in the admin tools then you can set an auto refresh flag. If set, the update process auto refreshes and you won't need to click 'continue' anymore.
The big advantage.... you can set the number of images to process to a  low value eg (2-5). Now the chances the script times out are limited. Means you don't need to restart the entire process and sit in front of your monitor for hours clicking 'continue' (if you've a huge number of pics in your db)
You can turn auto refresh on/ and off on the admin tools page
Update thumbs and/or resized photos (1) - (checkbox) Auto refresh (no need to click continue button anymore)

To undo watermarks just disable watermarking in config and run the admin tools.
Oh, no you can chose in the admin tools to update only thumbs, only intermediate, only fullsized, thumb and intermediate, intermediate and fullsized or all three

Of course you can delete the backup too (admin tools - Delete original image backup)
However I do not recommend this. Afterwards you won't be able to undo your watermarks. Better undo watermarks and then remove the backup files (unless you're absolutely sure you never will want to remove the watermarks)

Setup:
just apply the following code, replace include/picmgmnt.inc.php with the attached file and run update.php

now have a look at your coppermine config. You'll need to modify the path to the watermark. Preset is a file watermark.png in the coppermine images folder. If that doesn't work for you, use the absolute path to the watermark image

The watermark image should be a .png file. You can make its background transparent in your paint program. Another option to achive that effect is to use feather x,y (GD2 only). Set some point x,y of your watermark image and GD2 will render it transparent. This will not nearly look as good as doing that in your paint program.  The transparency settings in config will make the entire watermark transparent to the image background (ImageMagick only).
If you use GD2 then the transparency setting in config has no function. If you want the watermark to be transparent against the background, then reduce layer transparency of your watermark image in your paint proggy to eg. 50

I was working on the watermark mod and have enhanced it's functionality. Now it's able to add a huge watermark file to huge  images and downsize the watermark on small images.
go here to apply the extra http://forum.coppermine-gallery.net/index.php?topic=29817.msg143122#msg143122


Title: Re: Permanant watermark with undo possibility (GD2+IMagick) + better admin tools
Post by: Stramm on March 31, 2006, 03:34:14 pm
Always make a backup of your files and the db before applying a mod

For the Germans: I've written an upgrade guide that explains backing up database and files on *nix systems.
http://forum.coppermine-gallery.net/index.php?topic=30411.msg140843#msg140843


-sql/update.sql
scroll down to the end of that file and add
Code: [Select]
#watermark
INSERT INTO CPG_config (name, value) values ('enable_watermark', '0');
INSERT INTO CPG_config (name, value) values ('where_put_watermark', 'southeast');
INSERT INTO CPG_config (name, value) values ('watermark_file', 'images/watermark.png');
INSERT INTO CPG_config (name, value) values ('which_files_to_watermark', 'both');
INSERT INTO CPG_config (name, value) values ('orig_pfx', 'orig_');
INSERT INTO CPG_config (name, value) values ('watermark_transparency', '50');
INSERT INTO CPG_config (name, value) values ('watermark_transparency_featherx', '0');
INSERT INTO CPG_config (name, value) values ('watermark_transparency_feathery', '0');


-lang/english.php
find
Code: [Select]
if (defined('ADMIN_PHP')) $lang_admin_php = array(
below add
Code: [Select]
  'wm_bottomright' => 'Bottom right', //cpg1.4 mod watermark
  'wm_bottomleft' => 'Bottom left', //cpg1.4 mod watermark
  'wm_topleft' => 'Up left', //cpg1.4 mod watermark
  'wm_topright' => 'Up Right', //cpg1.4 mod watermark
  'wm_center' => 'Center', //cpg1.4 mod watermark
  'wm_both' => 'Both', //cpg1.4 mod watermark
  'wm_original' => 'Original', //cpg1.4 mod watermark
  'wm_resized' => 'Resized', //cpg1.4 mod watermark

find
Code: [Select]
  array('Default mode for files', 'default_file_mode', 0, 'f=index.htm&as=admin_picture_thumb_advanced_chmod_files&ae=admin_picture_thumb_advanced_chmod_files_end'), //cpg1.4
below add
Code: [Select]

  'Image watermarking',
  array('Watermark Image', 'enable_watermark', 1),
  array('Where to place the watermark', 'where_put_watermark', 18),
  array('Which files to watermark', 'which_files_to_watermark', 19),
  array('Which file to use for watermark', 'watermark_file', 0),
  array('Transparency 0-100 for entire image', 'watermark_transparency', 0),
  array('Set color transparent x (GD2 only)', 'watermark_transparency_featherx', 0),
  array('Set color transparent y (GD2 only)', 'watermark_transparency_feathery', 0),

find
Code: [Select]
  'delete_orphans_explanation' => 'This will identify and allow you to delete any comments associated with files no longer in the gallery.<br />Checks all albums.', //cpg1.4
below add
Code: [Select]
  'update_full_normal_thumb' => 'Everything... full sized, resized and thumbs',
  'update_full_normal' => 'Both resized and full sized (if a orig copy is available)',
  'update_full' => 'Just full sized (if a orig copy is available)',
  'delete_back' => 'Delete original image backup (watermark mod)',
  'delete_back_explanation' => 'This will delete the backup image. You will save some disk space but not be able anymore to undo the watermark!!! After that the watermark will be permanent',
  'finished' => '<br />Finished updating thumbs/ images!<br />', //modpack cpg1.4
  'autorefresh' => ' Auto refresh (no need to click continue button anymore)<br /><br />', //modpack cpg1.4

find
Code: [Select]
  'fs_pic' => 'full size image',
below add
Code: [Select]
  'orig_pic' => 'original image',


-admin.php
find 
Code: [Select]
function create_form(&$data)
above add
Code: [Select]
function form_watermark($text, $name)
{
   global $CONFIG, $lang_admin_php;

   $value = $CONFIG[$name];
   $southeast_selected = ($value == 'southeast') ? 'selected' : '';
   $southwest_selected = ($value == 'southwest') ? 'selected' : '';
   $northwest_selected = ($value == 'northwest') ? 'selected' : '';
   $northeast_selected = ($value == 'northeast') ? 'selected' : '';
   $center_selected = ($value == 'center') ? 'selected' : '';

   echo <<<EOT
       <tr>
           <td class="tableb">
                       $text
       </td>
       <td class="tableb" valign="top">
                       <select name="$name" class="listbox">
                               <option value="southeast" $southeast_selected>{$lang_admin_php['wm_bottomright']}</option>
                               <option value="southwest" $southwest_selected>{$lang_admin_php['wm_bottomleft']}</option>
                               <option value="northwest" $northwest_selected>{$lang_admin_php['wm_topleft']}</option>
                               <option value="northeast" $northeast_selected>{$lang_admin_php['wm_topright']}</option>
                               <option value="center" $center_selected>{$lang_admin_php['wm_center']}</option>
                       </select>
               </td>
       </tr>

EOT;
}
// Added for allowing user to select which files to watermark...
function form_watermark2($text, $name)
{
   global $CONFIG, $lang_admin_php;

   $value = $CONFIG[$name];
   $both_selected = ($value == 'both') ? 'selected' : '';
   $original_selected = ($value == 'original') ? 'selected' : '';
   $resized_selected = ($value == 'resized') ? 'selected' : '';

   echo <<<EOT
       <tr>
           <td class="tableb">
                       $text
       </td>
       <td class="tableb" valign="top">
                       <select name="$name" class="listbox">
                               <option value="both" $both_selected>{$lang_admin_php['wm_both']}</option>
                               <option value="original" $original_selected>{$lang_admin_php['wm_original']}</option>
                               <option value="resized" $resized_selected>{$lang_admin_php['wm_resized']}</option>
                       </select>
               </td>
       </tr>

EOT;
}



find
Code: [Select]
                case 17 :
                    form_asc_desc($element[0], $element[1], $element[3]);
                    break;
below add
Code: [Select]
              //Watermark place
              case 18 :
                  form_watermark($element[0], $element[1]);
                    break;
              //Which filest to watermark
              case 19 :
                  form_watermark2($element[0], $element[1]);
                    break;


-util.php
find
Code: [Select]
$defpicnum = 45;
and replace with
Code: [Select]
$defpicnum = 5;

find
Code: [Select]
                <input type="radio" name="updatetype" id="updatetype3" value="2" checked="checked" class="nobg" /><label for="updatetype3" class="clickable_option">'.$lang_util_php['update_both'].'</label><br />'.$lang_util_php['update_number'].'
                <input type="text" name="numpics" value="'.$defpicnum.'" size="5" class="textinput" /><br />'.$lang_util_php['update_option'].'<br /><br />'),
and replace with
Code: [Select]
                <input type="radio" name="updatetype" id="updatetype3" value="2" class="nobg" /><label for="updatetype3" class="clickable_option">'.$lang_util_php['update_both'].'</label><br />
                <input type="radio" name="updatetype" id="updatetype5" value="4" class="nobg" /><label for="updatetype5" class="clickable_option">'.$lang_util_php['update_full'].'</label><br />
                <input type="radio" name="updatetype" id="updatetype4" value="3" checked="checked" class="nobg" /><label for="updatetype4" class="clickable_option">'.$lang_util_php['update_full_normal'].'</label><br />
                <input type="radio" name="updatetype" id="updatetype6" value="5" class="nobg" /><label for="updatetype6" class="clickable_option">'.$lang_util_php['update_full_normal_thumb'].'</label><br />
'.$lang_util_php['update_number'].'
                <input type="text" name="numpics" value="'.$defpicnum.'" size="5" class="textinput" /><br />'.$lang_util_php['update_option'].'<br /><br />
                <input type="Checkbox" name="autorefresh" checked value="1" class="nobg" />'.$lang_util_php['autorefresh']
),

replace the entire function update_thumbs() with

Code: [Select]
function update_thumbs()
{
        global $CONFIG, $lang_util_php;

        $albumid = (isset($_REQUEST['albumid'])) ? $_REQUEST['albumid'] : 0;
        $albstr = ($albumid) ? "WHERE aid = $albumid" : '';
        $autorefresh = $_REQUEST['autorefresh'];
        $updatetype = $_REQUEST['updatetype'];
        $numpics = $_REQUEST['numpics'];
        $startpic = (isset($_REQUEST['startpic'])) ? $_REQUEST['startpic'] : 0;

        echo "<h2>{$lang_util_php['thumbs_wait']}</h2>";

        $result = cpg_db_query("SELECT * FROM {$CONFIG['TABLE_PICTURES']} $albstr LIMIT $startpic, $numpics");
        $count = mysql_num_rows($result);

        while ($row = mysql_fetch_assoc($result)){

                $image = $CONFIG['fullpath'] . $row['filepath'] . $row['filename'];
                $normal = $CONFIG['fullpath'] . $row['filepath'] . $CONFIG['normal_pfx'] . $row['filename'];
                $thumb = $CONFIG['fullpath'] . $row['filepath'] . $CONFIG['thumb_pfx'] . $row['filename'];
                $mini = $CONFIG['fullpath'] . $row['filepath'] . $CONFIG['mini_pfx'] . $row['filename'];
$orig=$CONFIG['fullpath'] . $row['filepath'] . $CONFIG['orig_pfx'] . $row['filename'];

if (file_exists($orig)) {
$work_image=$orig;
$orig_true='true';
} else {
$work_image=$image;
$orig_true='false';
}

        $imagesize = getimagesize($work_image);
        if ($updatetype == 0 || $updatetype == 2 || $updatetype == 5)  {
            if (resize_image($work_image, $thumb, $CONFIG['thumb_width'], $CONFIG['thumb_method'], $CONFIG['thumb_use'], "false", 1)) {
                echo $thumb .' '. $lang_util_php['updated_succesfully'] . '!<br />';
                my_flush();
            } else {
                echo $lang_util_php['error_create'] . ':$thumb<br />';
                my_flush();
            }
        if ($CONFIG['enable_mini_thumbs'] == '1') {
            if (resize_image($work_image, $mini, $CONFIG['mini_thumb_width'], $CONFIG['thumb_method'], "mini", "false", 1)) {
                echo $mini .' '. $lang_util_php['updated_succesfully'] . '!<br />';
                my_flush();
            } else {
                echo $lang_util_php['error_create'] . ':$mini<br />';
                my_flush();
            }
}
}

        if ($updatetype == 1 || $updatetype == 2 || $updatetype == 3 || $updatetype == 5)
{
            ($CONFIG['enable_watermark'] == '1' && $CONFIG['which_files_to_watermark'] == 'both' || $CONFIG['which_files_to_watermark'] == 'resized') ? $watermark="true" : $watermark="false";
            if (max($imagesize[0], $imagesize[1]) > $CONFIG['picture_width'] && $CONFIG['make_intermediate'])
{
                if (resize_image($work_image, $normal, $CONFIG['picture_width'], $CONFIG['thumb_method'], $CONFIG['thumb_use'], $watermark))
{
                    echo $normal . " " . $lang_util_php['updated_succesfully'] . '!<br />';
                    my_flush();
}
                else
{
                    echo $lang_util_php['error_create'] . ':$normal<br />';
                    my_flush();
                }
            }
}
        if ($updatetype == 3 || $updatetype == 4 || $updatetype == 5) 
{
($CONFIG['thumb_use'] == "ex") ? $resize_method = "any" : $resize_method = $CONFIG['thumb_use'];

        if (((USER_IS_ADMIN && $CONFIG['auto_resize'] == 1) || (!USER_IS_ADMIN && $CONFIG['auto_resize'] > 0)) && max($imagesize[0], $imagesize[1]) > $CONFIG['max_upl_width_height']){ //$CONFIG['auto_resize']==1
$max_size_size = $CONFIG['max_upl_width_height'];
}
else {
$resize_method = "orig";
$max_size_size = max($imagesize[0], $imagesize[1]);
}
if ($orig_true == 'false')
{
if (copy($image, $orig))
{        
        if ($CONFIG['enable_watermark'] == '1' && $CONFIG['which_files_to_watermark'] == 'both' || $CONFIG['which_files_to_watermark'] == 'original')
{
if (resize_image($work_image, $image, $max_size_size, $CONFIG['thumb_method'], $resize_method, 'true'))
{
             echo $image . " " . $lang_util_php['updated_succesfully'] . '!<br />';
             my_flush();
}
                else
{
                    echo $lang_util_php['error_create'] . ':$image<br />';
                    my_flush();
                }
}
}
} else {
        if ($CONFIG['enable_watermark'] == '1' && $CONFIG['which_files_to_watermark'] == 'both' || $CONFIG['which_files_to_watermark'] == 'original')
{
if (resize_image($work_image, $image, $max_size_size, $CONFIG['thumb_method'], $resize_method, 'true'))
{
             echo $image . " " . $lang_util_php['updated_succesfully'] . '!<br />';
             my_flush();
}
                else
{
                    echo $lang_util_php['error_create'] . ':$image<br />';
                    my_flush();
                }
} else {
        if (((USER_IS_ADMIN && $CONFIG['auto_resize'] == 1) || (!USER_IS_ADMIN && $CONFIG['auto_resize'] > 0)) && max($imagesize[0], $imagesize[1]) > $CONFIG['max_upl_width_height']){
if (resize_image($work_image, $image, $max_size_size, $CONFIG['thumb_method'], $resize_method, 'false'))
{
             echo $image . " " . $lang_util_php['updated_succesfully'] . '!<br />';
             my_flush();
}
                else
{
                    echo $lang_util_php['error_create'] . ':$image<br />';
                    my_flush();
                }
} elseif (copy($orig, $image))
{
                    echo $orig . " " . $lang_util_php['updated_succesfully'] . '!<br />';
                    my_flush();
}
                else
{
                    echo $lang_util_php['error_create'] . ':$image<br />';
                    my_flush();
                }
}
}
}
        $imagesize = getimagesize($image);
$query_up = "UPDATE {$CONFIG['TABLE_PICTURES']} SET pwidth='$imagesize[0]' , pheight='$imagesize[1]' WHERE pid='".$row['pid']."' ";
cpg_db_query($query_up);
}

        if ($count == $numpics){

                $startpic += $numpics;
if($autorefresh) {
echo <<< EOT
<meta http-equiv="refresh" content="1; URL=util.php?numpics={$numpics}&startpic={$startpic}&albumid={$albumid}&autorefresh={$autorefresh}&action=update_thumbs&updatetype={$updatetype}">
EOT;
}
else
{
        echo <<< EOT
                <form action="util.php" method="post">
                                <input type="hidden" name="action" value="update_thumbs" />
                                <input type="hidden" name="numpics" value="$numpics" />
                                <input type="hidden" name="startpic" value="$startpic" />
                                <input type="hidden" name="updatetype" value="$updatetype" />
                                <input type="hidden" name="albumid" value="$albumid" />
                                <input type="hidden" name="autorefresh" value="$autorefresh" />
                                <input type="submit" value="{$lang_util_php['continue']}" class="button" />
                </form>
EOT;
}
        }
else echo $lang_util_php['finished'];
}

function deletbackup_img()
{
        global $CONFIG, $lang_util_php;

        $albumid = (isset($_POST['albumid'])) ? $_POST['albumid'] : 0;
        $albstr = ($albumid) ? "WHERE aid = $albumid" : '';

        $result = cpg_db_query("SELECT * FROM {$CONFIG['TABLE_PICTURES']} $albstr");
        $num = mysql_num_rows($result);
    $i = 0;
    while ($i < $num) {
        $pid = mysql_result($result, $i, "pid");
        $back = $CONFIG['fullpath'] . mysql_result($result, $i, "filepath") . $CONFIG['orig_pfx'] . mysql_result($result, $i, "filename");

        if (file_exists($back)) {
if(unlink($back)){
                printf("Success".$lang_util_php['main_success'], $back);
                print '!<br>';
}
            } else {
                printf("Error".$lang_util_php['error_rename'], $back);
            }
        ++$i;
    }
}


find
Code: [Select]

        'del_orphans' => array('del_orphans', $lang_util_php['delete_orphans'], $lang_util_php['delete_orphans_explanation']),
below add
Code: [Select]

        'deletbackup_img' => array('deletbackup_img', $lang_util_php['delete_back'], $lang_util_php['delete_back_explanation']),
Title: Re: Permanant watermark with undo possibility (GD2+IMagick) + better admin tools
Post by: Stramm on March 31, 2006, 03:34:30 pm
-delete.php
find
Code: [Select]
function output_table_header()
{
    global $header_printed, $need_caption, $lang_delete_php;

    $header_printed = true;
    $need_caption = true;

echo <<<EOT
<tr>
<td class="tableh2"><b>{$lang_delete_php['npic']}</b></td>
<td class="tableh2" align="center"><b>{$lang_delete_php['fs_pic']}</b></td>
<td class="tableh2" align="center"><b>{$lang_delete_php['ns_pic']}</b></td>
<td class="tableh2" align="center"><b>{$lang_delete_php['thumb_pic']}</b></td>
<td class="tableh2" align="center"><b>{$lang_delete_php['comment']}</b></td>
<td class="tableh2" align="center"><b>{$lang_delete_php['im_in_alb']}</b></td>
</tr>
EOT;
}

function output_caption()
{
    global $lang_delete_php
    ?>
<tr><td colspan="6" class="tableb">&nbsp;</td></tr>
<tr><td colspan="6" class="tableh2"><b><?php echo $lang_delete_php['caption'?></b></tr>
<tr><td colspan="6" class="tableb">
<table cellpadding="1" cellspacing="0">
<tr><td><b>F</b></td><td>:</td><td><?php echo $lang_delete_php['fs_pic'?></td><td width="20">&nbsp;</td><td><img src="images/green.gif" border="0" width="12" height="12" align="absmiddle"></td><td>:</td><td><?php echo $lang_delete_php['del_success'?></td></tr>
<tr><td><b>N</b></td><td>:</td><td><?php echo $lang_delete_php['ns_pic'?></td><td width="20">&nbsp</td><td><img src="images/red.gif" border="0" width="12" height="12" align="absmiddle"></td><td>:</td><td><?php echo $lang_delete_php['err_del'?></td></tr>
<tr><td><b>T</b></td><td>:</td><td><?php echo $lang_delete_php['thumb_pic'?></td></tr>
<tr><td><b>C</b></td><td>:</td><td><?php echo $lang_delete_php['comment'?></td></tr>
<tr><td><b>D</b></td><td>:</td><td><?php echo $lang_delete_php['im_in_alb'?></td></tr>
</table>
</td>
</tr>
<?php
}
and replace with
Code: [Select]
function output_table_header()
{
    global $header_printed, $need_caption, $lang_delete_php;

    $header_printed = true;
    $need_caption = true;

echo <<<EOT
<tr>
<td class="tableh2"><b>{$lang_delete_php['npic']}</b></td>
<td class="tableh2" align="center"><b>{$lang_delete_php['fs_pic']}</b></td>
<td class="tableh2" align="center"><b>{$lang_delete_php['ns_pic']}</b></td>
<td class="tableh2" align="center"><b>{$lang_delete_php['orig_pic']}</b></td>
<td class="tableh2" align="center"><b>{$lang_delete_php['thumb_pic']}</b></td>
<td class="tableh2" align="center"><b>{$lang_delete_php['comment']}</b></td>
<td class="tableh2" align="center"><b>{$lang_delete_php['im_in_alb']}</b></td>
</tr>
EOT;
}


function output_caption()
{
    global $lang_delete_php
    ?>
<tr><td colspan="7" class="tableb">&nbsp;</td></tr>
<tr><td colspan="7" class="tableh2"><b><?php echo $lang_delete_php['caption'?></b></tr>
<tr><td colspan="7" class="tableb">
<table cellpadding="1" cellspacing="0">
<tr><td><b>F</b></td><td>:</td><td><?php echo $lang_delete_php['fs_pic'?></td><td width="20">&nbsp;</td><td><img src="images/green.gif" border="0" width="12" height="12" align="absmiddle"></td><td>:</td><td><?php echo $lang_delete_php['del_success'?></td></tr>
<tr><td><b>N</b></td><td>:</td><td><?php echo $lang_delete_php['ns_pic'?></td><td width="20">&nbsp</td><td><img src="images/red.gif" border="0" width="12" height="12" align="absmiddle"></td><td>:</td><td><?php echo $lang_delete_php['err_del'?></td></tr>
<tr><td><b>O</b></td><td>:</td><td><?php echo $lang_delete_php['orig_pic'?></td></tr>
<tr><td><b>T</b></td><td>:</td><td><?php echo $lang_delete_php['thumb_pic'?></td></tr>
<tr><td><b>C</b></td><td>:</td><td><?php echo $lang_delete_php['comment'?></td></tr>
<tr><td><b>D</b></td><td>:</td><td><?php echo $lang_delete_php['im_in_alb'?></td></tr>
</table>
</td>
</tr>
<?php
}

find
Code: [Select]
    $files = array($dir . $file, $dir . $CONFIG['normal_pfx'] . $file, $dir . $CONFIG['thumb_pfx'] . $file);
replace with
Code: [Select]
    $files = array($dir . $file, $dir . $CONFIG['normal_pfx'] . $file, $dir . $CONFIG['orig_pfx'] . $file, $dir . $CONFIG['thumb_pfx'] . $file);


find
Code: [Select]
        starttable("100%", $lang_delete_php['del_pic'], 6);
        output_table_header();
        $aid = delete_picture($pid);
        output_caption();
        echo "<tr><td colspan=\"6\" class=\"tablef\" align=\"center\">\n";
replace with
Code: [Select]
        starttable("100%", $lang_delete_php['del_pic'], 7);
        output_table_header();
        $aid = delete_picture($pid);
        output_caption();
        echo "<tr><td colspan=\"7\" class=\"tablef\" align=\"center\">\n";


editpics.php
find
Code: [Select]
                        $files=array($dir.$file, $dir.$CONFIG['normal_pfx'].$file, $dir.$CONFIG['thumb_pfx'].$file);
replace with
Code: [Select]
                        $files=array($dir.$file, $dir.$CONFIG['normal_pfx'].$file, $dir.$CONFIG['thumb_pfx'].$file, $dir.$CONFIG['orig_pfx'].$file);

searchnew.php
find
Code: [Select]
            if (strncmp($file, $CONFIG['thumb_pfx'], strlen($CONFIG['thumb_pfx'])) != 0 && strncmp($file, $CONFIG['normal_pfx'], strlen($CONFIG['normal_pfx'])) != 0 && $file != 'index.html') {
replace with
Code: [Select]
            if (strncmp($file, $CONFIG['orig_pfx'], strlen($CONFIG['orig_pfx'])) != 0 && strncmp($file, $CONFIG['thumb_pfx'], strlen($CONFIG['thumb_pfx'])) != 0 && strncmp($file, $CONFIG['normal_pfx'], strlen($CONFIG['normal_pfx'])) != 0 && $file != 'index.html') {

                  
                                    
now just replace include/picmgmnt.inc.php with the attached one

if you want to have the 'automatically downsize watermark on small images' functionality go here http://forum.coppermine-gallery.net/index.php?topic=29817.msg143122#msg143122
(just a minute of extra work and well worth it ;) )
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: freesouljah on April 02, 2006, 05:42:40 am
hey bro, what do I need to change to get the auto process mod (http://forum.coppermine-gallery.net/index.php?topic=16286.msg92238#msg92238) you built for util.php to work with 1.4x

thanks man....keep up the excellent work  8)
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Stramm on April 02, 2006, 10:44:44 am
it's 'built in' in the above hack
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: freesouljah on April 03, 2006, 05:58:26 am
it's 'built in' in the above hack

 ::) I guess I should have read your post completely before asking...  :-X

thanks
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: Ross(SE-MI) on April 05, 2006, 04:35:09 am
Great job on this mod Stramm. :)
Working very good on my site.
Thank You
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: woodysfj40 on April 18, 2006, 04:27:12 pm
I received the following error...redid the hack to this file, and the error still occurs....

Code: [Select]
Parse error: syntax error, unexpected '}' in /home/gallery/searchnew.php on line 264
your replacement code needs to include the final '{' in that line...
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Stramm on April 18, 2006, 05:12:52 pm
yes, I've added the starting bracket '{' now, thanks
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: ISBB on April 20, 2006, 05:02:51 am
Another MasterPiece Strahm.. Works wonders on my site... But for future modifications to this mod it would be cool to have 2 diff size watermarks like the Plugin offers...   A smaller one for the Intermediate pictures and the regular sized one for the Originals...

But im very pleased as the mod went smoothly and without issue.. :D  Thx for the hard work bud!!
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Stramm on April 22, 2006, 08:29:52 am
Another MasterPiece Strahm.. Works wonders on my site... But for future modifications to this mod it would be cool to have 2 diff size watermarks like the Plugin offers...   A smaller one for the Intermediate pictures and the regular sized one for the Originals...

But im very pleased as the mod went smoothly and without issue.. :D  Thx for the hard work bud!!

yup, nice idea, should be easy to do
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: Farsider on April 26, 2006, 03:31:52 pm
Stramm

Think i'm missing something here. 

I have created a file called watermark.png and have tried referencing it with full path as well as the default "images/watermark.png".
I have applied the mod, modified all the relevent pages, run the update and enabled the Watermark option in the config.  I have run the admin tools to update images, tried uploading fresh images via the "File Upload" and "Batch Add" but none of my images seem to be getting a watermark applied and no errors seem to have been thrown up anywhere.  I'm sure it is one of those idiot errors on my behalf but im sure I will not be the only one to full into the trap I am in.

Let me take the time to commend you and the team with the great work you have done with coppermine.
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Stramm on April 26, 2006, 04:29:39 pm
you replaced the picmgmnt.inc.php with the attached one?
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: Jarvhix on April 27, 2006, 04:15:55 am
 :'(

Hi, I tried the code and have everything added and edited as stated and I get this error when I try to run the refresh in (admin tools)

Updating thumbnails and/or resized images, please wait...
ERROR creating:$thumb
ERROR creating:$image
ERROR creating:$thumb
ERROR creating:$image
ERROR creating:$thumb
ERROR creating:$image
ERROR creating:$thumb
ERROR creating:$image
ERROR creating:$thumb


and then I can't upload an image. It doesn't upload at all. When I run the upload it says:

The previous file could not be placed.

You have successfully placed all the files.


and the image is not uploaded to it's requested destination.
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Stramm on April 27, 2006, 09:10:34 am
properly chmod folders and files.. that's especially important if you upgraded.
Reason, now the images get modified and saved again, and that's doing php/ GD2. When you initially uploaded it was apache/ http upload. -> if both run under different users you then group or anon write permissions arte necessary

-> 666 files, 777 folders

Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: Jarvhix on April 27, 2006, 03:53:22 pm
666 ALL copermine files? And 777 ALL Coppermine folders?
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Stramm on April 27, 2006, 04:01:34 pm
777 albums folder and its subfolders
666 all files in the albums folder and its subfolders

I assume you properly applied the mod... make sure bedore strating to chmod. First chmod folders, test, then chmod files
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: Jarvhix on April 27, 2006, 04:09:12 pm
Thanks. Yes, the Albums folder is already 777 as well the sub-folders. There are only two files each, in the Edit folder, and the Userpics Folder : index.php and no-FTP-upload file.


Are the files from the main directory to be 644 or 666 also?
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Stramm on April 27, 2006, 04:21:49 pm
nothing else needs chmodding except (if you upgarded from 1.3 to 1.4) the files and folders in the albums dir (as already said)

you said the admin tools spit out
Updating thumbnails and/or resized images, please wait...
ERROR creating:$thumb
ERROR creating:$image

--> you've files in the albums dir or its subdirs
usually you get that when coppermine finds a non image file (a movie, pdf etc) that gd2, ImageMagick can't handle. Standard behaviour

Double check if you followed the instructions
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: Jarvhix on April 27, 2006, 04:25:22 pm
Uh-oh, now I'm confused. Check what instructions? I don't have any movies or pdf in the albums folder. Only images in the userpics folder and a folder for batch uploading. But they are all chmod accordingly. I asked about the main files because I noticed that they are not all the same chmod. Some of the files in the main directory of coppermine, are 644 and some are 666
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Stramm on April 27, 2006, 04:51:56 pm
don't chmod anything except albums folder and stuff in here
and these instructions. If you messed something up when applying the mod... bad luck
http://forum.coppermine-gallery.net/index.php?topic=29817.msg137994#msg137994
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: Jarvhix on April 27, 2006, 04:54:59 pm
Right, so I'm just going to remove the mod then. I've already noticed some strange things happening. I can't do anything with it if it's not working. Thanks. T/C
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: Jarvhix on April 29, 2006, 12:24:45 am
I posted in a forum for support on the hits count/stats. After I applied your mod, somehow my hits stats changed from 127,000 to 0. How can I correct that?
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Stramm on April 29, 2006, 08:41:40 am
This mod doesn't have anything to do with 'hit stats'. I have no clue at all what you've done. Even with messing up code while applying it, there's no obvious part where it may affect hit stats.

edit: You've written you ran the admin tools... by default 'Reset view counters' is set. If you've missed to click 'Update thumbs and/or resized photos' you can imagine what happened... -> you've reseted your view counts.

If you don't have a backup of your db nothing can be done to undo that. In general before applying mods it's advisable to make backups of everything (db and files). Before playing with the admin tools double check it's set to what you want
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Stramm on April 29, 2006, 05:54:49 pm
a mod for the mod...
Atm on all images (intermediate and fullsized) the same watermark gets applied. However it may look oversized on the intermediate. Now it's possible to let the watermark mod calculate a reduced watermark size for small images.

I just copy the description from my modpack.
Automatically downsizing of the watermark image when the uploaded picture is smaller than the width you set (Downsize watermark if width of an picture is smaller than entered value. That is the 100% reference point. Resizing of the watermark is linear (0 to disable)).
If you eg. enter here 1024 (like I did on my demo site), then the 100% reference is at images with a width of 1024px or bigger. If you upload pics > 1024px the watermark image won't get resized and attached with its full size. If you let coppermine create an intermediate image with a width of 400 pics, then the watermark will get downsized to 39% of it's original size. Is the fullsized eg. 512px, then the watermark will have 50% of it's orig size. Of course this sucks some CPU. And it's working excellent together with (example: http://stramm.st.funpic.org/displayimage.php?pos=-96 )
Files and thumbnails settings -> Auto resize images that are larger than max width or height (set it to the same as you used for the 100% reference... in the example 1024)
this way the watermark will always fit perfectly onto your images.

I assume you already applied the watermark mod in this thread and you have it working. That's the changes you have to do then.

sql/update.sql
at the end of this file add
Code: [Select]
INSERT INTO CPG_config (name, value) values ('reduce_watermark', '0');

lang/english.php
find
Code: [Select]
  array('Transparency 0-100 for entire image', 'watermark_transparency', 0),
below add
Code: [Select]
  array('Downsize watermark if width of an picture is smaller than entered value. That is the 100% reference point. Resizing of the watermark is linear (0 to disable)', 'reduce_watermark', 0),


now download the attached file, unpack it and upload it in your include folder replacing the existing file (include/picmgmnt.inc.php)
run update.php

have fun

PS: I've attached a test watermark png... feel free to experiment with it. The watermark file has a layer transparency of ~60-70% (have forgotten what value exactly) so you should see the image through it. Usually I have it in the images/ directory, if you do the same, then the path is images/watermark.png

an example: http://stramm.st.funpic.org/displayimage.php?album=7&pos=5


new attached file.... picmgmnt.inc.1.4.6.zip is the latest picmgmnt.inc.php file for CPG 1.4.6-1.4.8
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: DarioDN on May 01, 2006, 05:18:15 pm
i've replace the file attached, modify the files.
I've update the old images by Admin Tools, but the watermark doesn't appears on the old images.
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Stramm on May 01, 2006, 06:44:06 pm
you need to enable the watermark in config
you need check twice if you followed the instructions 100%
make sure albums folder and it's subfolders are chmod 777 or 755 (depending on your system) and the files at least 644
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: CanadianGuy on May 10, 2006, 04:48:00 am
Help, i have the new Coppermine 1.4.5 and i have it install and all, and i want to put watermark on the pics. can someone help me out please :(
it would be great help?
is there step by step i can follow to have watermark? please help, it would mean alot

ty
Joey from Canada
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Stramm on May 10, 2006, 08:07:21 am
for this mod... read here http://forum.coppermine-gallery.net/index.php?topic=29817.msg137993#msg137993
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: war59312 on May 17, 2006, 01:05:30 am
Hey,

Awesome mod!  ;D

However, there is no "sql/sql.inc" . lol

Thanks a lot,

Will
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Stramm on May 17, 2006, 07:40:31 am
Thanks ;)
but where do I talk about sql.inc?? Maybe you mean update.sql
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: war59312 on May 20, 2006, 07:27:25 am
Hey,

And I quote:

sql/sql.inc
at the end of this file add
Code: [Select]
INSERT INTO CPG_config (name, value) values ('reduce_watermark', '0');

Right there, lol . A few posts up. That is reply 24.

Yeah I took it, as you meant update.sql. ;)

Take Care,

Will
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Stramm on May 20, 2006, 08:36:46 am
ahh.. OK, the enhancement on this site. I've edited my post above ;)
But I guess it wasn't a problem to find the correct file (at least after applying the main hack)

Thanks
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: AmanM on May 21, 2006, 01:40:41 am
sorry not working on my gallery i only find some strange stuff.In english gb i dont find the watermark in it but in us and than i cant see the listbox whith bottom right an so on its in the page ive you open the config you will find the entries before general settings
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Stramm on May 21, 2006, 10:26:03 am
lang/english.php = English US

If you can't see the watermark settings in config while your language is set to english US you probably made a mistake or two while applying the hack.

Solution:
-> replace your modified files with original ones and start again.
-> use a predone hack (like my modpack, the watermark hack is included there)
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: gerdo on May 22, 2006, 11:43:41 pm
It works great on v1.4.6
thnx man!
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: ISBB on May 31, 2006, 12:59:15 am
Strahm is there anything to worry about... I previously had 1.4.3 and upon upgrading to 1.4.6 i seem to have overwritten the files that were modded by this mod..   Is there any issue w/ me replacing the files that came w/ 1.4.6 w/ the ones i modded in 1.4.3??
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Stramm on May 31, 2006, 05:28:01 am
as far as I remember there were small changes in editpics and searchnew. But nothing critical.
Also there was a little bugfix in picmgmnt.inc.php. Up to date is always the picmgmnt.inc.php from the modpack. I'll attach a new one to the downsize enhancement (within this thread)
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: CubaLibre on June 03, 2006, 03:02:38 am
Hi, i follow instruction, but can't see option in config, i run update.php it say me OK for the line added, in admin.php all is done.
What can i check?

Thank you
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: CubaLibre on June 03, 2006, 03:07:37 am
Ok resolved, language problem ;)
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: 2notch on June 17, 2006, 08:57:48 am
(New install of cpg 1.4.8 )

Everything is working great...except one thing.
The intermediate image has the watermark on it. But when I click on the intermediate image a window (javascript?) opens up with the large image and the watermark is not there. This larger window seems to be getting the originally uploaded image.

View here: http://www.alyce51.com/gallery/displayimage.php?album=4&pos=0

In config I have set "Which files to watermark" to Both and I've checked file and folder permissions.

These are the images:
blueskies.jpg - uploaded file (no watermark)
normal_blueskies.jpg - has the watermark
orig_blueskies.jpg - no watermark
thumb_blueskies.jpg - no watermark

Have I missed something in config or do I need to hack the javascript?

Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Stramm on June 17, 2006, 09:24:30 am
usually that's file/ folder permissions. If you batch upload you'll have to make sure your folder 'skies' has the recommended permissions (777 or 755) and the file itself is chmodded 644 or 666 (depending on your server settings). Happens when the apache/ php user isn't the user or in the group who uploaded the  pic and therefore hasn't rights to change that file but has rights to make a copy and
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: 2notch on June 17, 2006, 10:08:47 am
That was it. The FTP program I was using on WinXP said the uploaded file was 666. I ssh'd into the site on my Linux machine and did an ls-al and it was really 644. I changed it there and batched added the file and now it works.

That's what I get for using WS-FTP and WinXP :P

Many thanks for your help!
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: gerapono on June 17, 2006, 04:52:06 pm
How can I watermark the pictures which are already on the site automatically ?
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Stramm on June 17, 2006, 04:54:41 pm
admin tools
check - Update thumbs and/or resized photos (1)
check - Both resized and full sized (if a orig copy is available)
check - Auto refresh (no need to click continue button anymore)
set Number of processed images per click to 5

scroll down, in the dropdown select 'All albums'

click 'submit
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: AK_CCM on June 21, 2006, 08:13:32 am
Hi Stramm,

thank you for the great mod. But I've got a problem with the "mod for the mod": My watermark image (60 x 456 pixel) won't be resized on the intermediate images:
http://www.pilze-augsburg.de/galerie/displayimage.php?album=3&pos=0

I still made the changes in sql/update.sql, lang/english.php abd language specific lang/german.php, copied the picmgmnt.inc.php from your mod-pack into the include-directory, uploaded the watermark image into the images-directory and ran the update.php.

In my config I also changed the option "Downsize watermark if width of an picture is smaller than entered value. That is the 100% reference point. Resizing of the watermark is linear (0 to disable)" to the "50" - is this value the percentage to resize the watermark image?

What's wrong - Could you help me please?

Regards, Andreas
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: AK_CCM on June 22, 2006, 07:36:56 am
Sorry for my inconvenience - I've reading the explanation
Quote
Downsize watermark if width of an picture is smaller than entered value. That is the 100% reference point. Resizing of the watermark is linear (0 to disable)" to the "50"
again and now everything is clear. The Downsizing-Mod works great!
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Stramm on June 22, 2006, 07:04:39 pm
OK, perfect...
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: Vanek on June 27, 2006, 02:27:55 pm
Hi!
If it's not too hard, can you make an option in the config — watermark padding (in pixels)? I think it's important feature ;)
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Stramm on June 28, 2006, 04:13:46 pm
you can hardcode that into picmgmnt.inc.php
if you use ImageMagick it's –geometry widthxheight

if you use GD2 you look for
Code: [Select]
    $pos = $CONFIG['where_put_watermark'];
if ($pos == "northwest") {

and below you change all '5' to the offset you'd prefer
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: danovo on July 09, 2006, 08:16:51 pm
Why doesnt it save my settings in Config?

Works for all other settings accept the Watermark Settings, it does not save them for some reason!

Dan.

Help
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Stramm on July 09, 2006, 08:39:36 pm
probably you haven't run update.php as mentioned in the first post
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: danovo on July 09, 2006, 09:26:19 pm
probably you haven't run update.php as mentioned in the first post

 I have run it, it just doesnt save

Dan
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Stramm on July 09, 2006, 09:36:41 pm
if it doesn't save you have made a mistake applying the mod. Usually the sql is missing
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: danovo on July 09, 2006, 10:01:43 pm
if it doesn't save you have made a mistake applying the mod. Usually the sql is missing

Okay so any idea how to correct this? Just apply the sql straight into the Database? will that work?
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: danovo on July 09, 2006, 10:03:48 pm
No worries, Sorted it
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Stramm on July 10, 2006, 12:33:13 am
what did you do? Maybe others can profit from your experience too
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: danovo on July 10, 2006, 03:55:58 pm
It was an sql problem, forgot to upload the sql file

Another Problem

the watermark works for new uploads that i do now, but i update the images using Admin Tools and it does not update the older images with Watermarks!

These were all FTP'd then Batch Added if this is any help

Dan.
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Stramm on July 10, 2006, 04:07:39 pm
yes, the FTP and batch add hint is helpful. You'll need to chmod them... I'd say the files to 666, folders 777. Depending on the server setup
if you know how to use the shell and if you have a lot of files/ folders here are two commands you can use
Code: [Select]
find . -type f -exec chmod 0666 {} \;
find . -type d -exec chmod 0777 {} \;
the first will chmod all files in a dir and all its subdirs 666
the second is for folders
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: GoTTi on August 06, 2006, 12:59:28 am
when i check yes to Watermark Image in the config area, it is not saving that setting.

the "Which file to use for watermark" is blank also.

what do i have to do after i install this?
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Stramm on August 06, 2006, 02:33:50 pm
Setup:
just apply the following code, replace include/picmgmnt.inc.php with the attached file and run update.php
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: GoTTi on August 07, 2006, 04:23:52 am
ok i did that, and now i have the settings set to on, and the path to watermark is images/watermark.png

first, is that images folder meaning inside the gallery folder? /public_html/gallery/images/ ??

second, when i set the option to on, and i have the watermark image in the folder, what do i do next? i uploaded a few test pics and i added them to gallery, and the watermark did not show.

thanks for your help.
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Stramm on August 07, 2006, 08:38:47 am
yes, that's the folder.
If it's not working then you probably made a mistake somewhere. Have you replaced the picmgmnt.inc.php (with the one added to the first post in here or the improved one http://forum.coppermine-gallery.net/index.php?topic=29817.msg143122#msg143122 )

Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: GoTTi on August 07, 2006, 03:49:14 pm
ok i changed the php file and now its working.

its only watermarking the preview image though, not the original and i have the setting set to both.

what would cause that?
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Stramm on August 07, 2006, 03:54:29 pm
Please read this thread
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: GoTTi on August 08, 2006, 06:20:24 am
got it:

http://forum.coppermine-gallery.net/index.php?topic=29817.msg152455#msg152455

thanks.
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: DarioDN on August 11, 2006, 07:41:11 pm
i've installed all and on single upload it's worked.

Now i've uploaded batch files and it shows the watermark only the intermediate image but not on the large image... how can i do?

tnx
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Stramm on August 11, 2006, 08:03:29 pm
the last guy who posted in here had the same problem  ::)
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: DarioDN on August 12, 2006, 09:19:51 am
yes, but the link reported don't resolve the problem (i'd the update but only the intermediates change)
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: DarioDN on August 12, 2006, 09:32:56 am
ok.. the permission is to be set on 666 and not on 644...  :D
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Armstrong on August 30, 2006, 05:09:35 pm
I've searched this entire post. Where is the attached file picmgmnt.inc.php

Could someone please point me in the right direction?
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Armstrong on August 30, 2006, 05:11:25 pm
cancel that. once i logged in it showed up.
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: claude258 on September 05, 2006, 12:37:39 am
I am trying to install this mod on:
http://www.fur4x-hebergement.net/claude/cpg149/index.php
but I get a critical error (as administrator) and a blank page (as visitor) when I try to add an image via HTTP.
Via FTP the image is not added.

Can you help?
Thanks




Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Stramm on September 05, 2006, 07:51:25 am
Have you updated the SQL and replaced the picmgmnt.inc.php file?
If yes, then check the modifications you did again. Somewhere you've made a mistake while applying the mod. Even better would be to restart from scratch
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: claude258 on September 05, 2006, 02:11:16 pm
I have updated the SQL and replaced the picmgmnt.inc.php. I have done all the modifications asked by the mod (restarted from scratch).

I still get the following error with HTTP upload (as administrator):
Quote
Erreur d'upload - './albums/edit/'

Fichier: /home/www/claude/cpg149/upload.php - Ligne: 2261

I get a blank (white page) with a upload as visitor.

With FTP upload, the image can't be added.

My image watermarking config:
The link used for the watermark file: www.fur4x-hebergement.net/claude/cpg149/images/watermark.png
Transparency:50
Set color transparent x (GD2 only): (blank)
Set color transparent Y (GD2 only): (blank)

I have to mention that I modified the french.php file instead of english.php. Is that the problem?

Link to the site:
http://www.fur4x-hebergement.net/claude/cpg149/index.php
debog is available.

Thanks.



Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: light2fire on September 06, 2006, 01:19:55 am
Hi everyone.

Quote
- possibility to assign different watermarks to certain users.

Is this also possible for this mod? (1.4.x)
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Stramm on September 06, 2006, 01:35:20 am
Claude, I just uploaded a test pic and all worked smooth (no white page or any error at all) except that no watermark got applied. But that's no wonder at all cause you've set a web URL for the path. That'S plain wrong. Either use the absolute or relative path
relative path: images/watermark.png
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Stramm on September 06, 2006, 01:36:13 am
Hi everyone.

Is this also possible for this mod? (1.4.x)

would be possible if you code the necessary changes
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: light2fire on September 06, 2006, 01:38:03 am
would be possible if you code the necessary changes
:-\ What are the changes I have to make?
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Stramm on September 06, 2006, 01:40:58 am
similar to the ones for 1.3... nothing major has changed. I do not know out of mind and would have to look that up myself too. If I remember right, then it was just some lil thingies in picmgmnt.inc.php - > compare that file with the standard modpack 1.3 picmgmnt.inc.php
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: light2fire on September 06, 2006, 01:46:17 am
Code: [Select]
    if ($watermark == "true"){
        $path_parts = pathinfo($CONFIG['watermark_file']);
        if (file_exists($path_parts["dirname"]."/".(USER_NAME).".png")) $wm_file = $path_parts["dirname"]."/".(USER_NAME).".png";
        else $wm_file = $CONFIG['watermark_file'];
    }

this piece?  :P
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: light2fire on September 06, 2006, 02:10:26 am
Ok, I changed the picmgmt.inc.php .
I uploaded a watermark with the same name as a username.
But when I upload the basic watermark is added...  ???

Code: [Select]
function resize_image($src_file, $dest_file, $new_size, $method, $thumb_use, $watermark="false", $sharpen=0,$media_type="false")
{
    global $CONFIG, $ERROR;
    global $lang_errors;


    if ($watermark == "true"){
        $path_parts = pathinfo($CONFIG['watermark_file']);
        if (file_exists($path_parts["dirname"]."/".(USER_NAME).".png")) $wm_file = $path_parts["dirname"]."/".(USER_NAME).".png";
        else $wm_file = $CONFIG['watermark_file'];
    }


    $imginfo = getimagesize($src_file);
    if ($imginfo == null)
        return false;
        // GD can only handle JPG & PNG images
    if ($imginfo[2] != GIS_JPG && $imageinfo[2] != GIS_PNG && $CONFIG['GIF_support'] == 0) {
        $ERROR = $lang_errors['gd_file_type_err'];
        return false;
    }
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: claude258 on September 06, 2006, 04:20:50 am
Claude, I just uploaded a test pic and all worked smooth (no white page or any error at all) except that no watermark got applied. But that's no wonder at all cause you've set a web URL for the path. That'S plain wrong. Either use the absolute or relative path
relative path: images/watermark.png

Thanks Stramm. I changed the path for the watermark.png.

I just found that if I upload a image of 800X600 (about 60ko) it is OK no problem. But if I upload a image of 1200X900 (about 200ko) I have the errors reported before. The image you uploaded with success was 640X480. I dont understand  ???

I tried to play with the config but no success.

The config for image is set as:
Max width or height of an intermediate picture/video: 800
Max size for uploaded files (KB): 3000
Max width or height for uploaded pictures (pixels): 1400

Link to the site:
http://www.fur4x-hebergement.net/claude/cpg149/index.php
debog is available.

Thanks.
claude


Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Joachim Müller on September 06, 2006, 07:05:35 am
@light2fire: this thread is for cpg1.4.x only. You're not allowed to ask questions for the outdated cpg1.3.x version of this mod in this thread. In fact, support for cpg1.3.x is running out. Instead of adding yet another mod to your cpg1.3.x-driven gallery I suggest you make up your mind on upgrading from cpg1.3.x to cpg1.4.x instead.
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Stramm on September 06, 2006, 08:44:58 am
Claude, you run into server sided limitations. Watermarking needs some more mem cause your box has to handle 2 pics instead of only one. Read the stickies in the upload support forums to get an idea what to do. Also you could (if installed) switch to ImageMagick

GauGau, light2fire is using 1.4 but asking how to port a function that was only avail in the 1.3 watermark mod

light2fire, that's not all changes. Search for the var $wm_file further more in picmgmnt.inc.php.
$CONFIG['watermark_file'] has been replaced with it. Not doing that change will result in having only the orig watermark.
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: light2fire on September 06, 2006, 02:41:44 pm
@stramm

yes :D found the replacement after some minutes. Changed it
Code: [Select]
} else { // shrink not enabled or no intermediate...
$logoImage = ImageCreateFromPNG($CONFIG['watermark_file']);
to
Code: [Select]
} else { // shrink not enabled or no intermediate...
$logoImage = ImageCreateFromPNG($wm_file);

Now it works for me (1.4.9) thx  ;D
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: claude258 on September 07, 2006, 03:11:58 pm
As you can see I am working hard to add this mod to my site but I have some problems :-\.
Now I am trying to add it to www.claudebriere.net. I made all the changes in the files including reduced watermark and run update.php.

1) With HTTP upload (as admin), after I choose the album to place the first uploaded image, I get a white page with the following error:
Quote
Fatal error: Call to undefined function: get_auto_subscribe_post() in /home/claudeb/public_html/coppermine/include/picmgmt.inc.php on line 167
But image is added correctly with watermark on resized and original. Of course, I can't place remaining images in appropriate albums.

2) With FTP upload, it seems to work but the watermark is added on resized image only (both rezised and original choosen in config). Note that I get DP remark for each images even if all images were new ??? (as you know DP means that the file is a duplicate and is already in the database).

3) Also, when I try to use the admin tools I get a white page withe the following error:
Quote
Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ')' in /home/claudeb/public_html/coppermine/util.php on line 52

I think I followed the mod instructions correctly. I tried a few times with the same results.

Claude
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Stramm on September 07, 2006, 06:51:04 pm
1. looks like you once had the modpack installed -> in your with phpmyadmin open your coppermine config table. Find the entry enable_user_notification and either delete it or set it to 0 (zero)

2. has been asked and answered in this thread and the modpack thread (file/ folder permissions is the magic)

3. I'd say you've made a mistake when applying the mod
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: claude258 on September 08, 2006, 02:35:10 pm
Thanks Stramm it is OK now ;D.

The only thing is that I dont know how to get a watermark like yours. You said that you use Paint. Is it microsoft Paint? I have this software on my computer but I dont know how to get a watermark like yours. I want the text to be transparent but I can't get it.

Is there other way to produce watermark like this? I search the web but watermark tutorials were not for watermark like yours.

I also tried to enter numbers in ''Set color transparent x, y (GD2 only)'' but it did not seems to have an effect on the watermark tranparency. What numbers should I write?

I know it should be easy to do but I dont get it.... :-\ 
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Stramm on September 08, 2006, 03:45:45 pm
What exactly want you do? My sample watermark is pretty basic. Just black text...

maybe the docs will help you to achive what you want
http://forum.coppermine-gallery.net/index.php?topic=28367.msg131255#msg131255
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: claude258 on September 08, 2006, 04:18:41 pm
My watermark:
http://claudebriere.net/coppermine/displayimage.php?pos=-1688

Your watermark:
http://claudebriere.net/coppermine/displayimage.php?pos=-1689

As you can see, my watermark as no transparency. I dont know how to get that transparency whit Microsoft Paint, PhotoFiltre or others... ??? Or can you do it for me ::)? (''claudebriere.net'' about same size, tranparency, etc...  as your watermak).

Or can I get it with ''Set color transparent x, y (GD2 only)'' ? Which number should I write?

Thanks again.
Claude
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Stramm on September 08, 2006, 04:33:52 pm
Quote
If you use GD2 then the transparency setting in config has no function. If you want the watermark to be transparent against the background, then reduce layer transparency of your watermark image in your paint proggy to eg. 50 (this I did for the sample watermark)...

In your paint program (I'm using Photoshop) you set the layer transparency to a value you like (40-60 usually is not bad at all). I never looked at MS Paint and never heared about PhotoFiltre so I can't help you with these.

Set color transparent x, y (GD2 only) has a total different functionality. Let's say pixel x34, y15 of your watermark image is white and you set 34, 15 in config for color transparent, then GD2 would try to eliminate white out of the watermark image. However it doesn't look really cool so I already thought about removing that feature.
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Stramm on September 08, 2006, 04:39:38 pm
I've attached a sample... width 400px so you can use it with the downsize feature
edit: layer transparency = 50%
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: claude258 on September 08, 2006, 10:07:02 pm
Thanks Stramm! It is really appreciated! ;)
Claude
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: Scuba_Si on September 14, 2006, 01:49:53 am
Hey Stramm,

I have everything working other than the actual watermark.  Everything gets imported ok, there's just no watermark present.  My files are not big (max dimension 600px)

I have read through this topic from page 1 to 5 several times now and im still lost!  I have a watermark.png file in my images folder ( Coppermine_directory/images/watermark.png). 

my link in my config is set to "images/watermark.png"

My CHMOD options on a linux server are set to 666 for the files and 777 for the folders.  I am using GD not imagemagick.

I have performed an update again, and still no luck!

Please help!

Simon
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Stramm on September 14, 2006, 04:29:44 pm
Please post a link to your gallery and a testuser account with permissions to upload pics

Maybe you want to try either to reduce the watermark size or to increase the mem limit. Looks to me like a resource problem

in include/picmgmnt.inc.php add
Code: [Select]
@ini_set('memory_limit', '32M');after
Code: [Select]
if (!defined('IN_COPPERMINE')) { die('Not in Coppermine...');}
this will not work in all environments. Depending on your php configuration you may have to set the mem limit in your php.ini
Read the sticky thread in the 1.4 upload problems forum to learn more about server sided restrictions
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: Scuba_Si on September 14, 2006, 06:13:00 pm
Hi Stramm,

Thanks for the info,

I am currently reloading coppermine onto my server with your modpack.  I will try the resource issues, and if i still cant work it out i will do as advised and post an account/link for you.

Thanks for your help,

Simon
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: Scuba_Si on September 15, 2006, 01:08:26 am
Thanks Stramm,

Got it working now, its great! I must have made an error in my script editing.


Thanks for your help, and if you need any info on the underwater stuff please feel free to ask.

Simon
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: jerx on September 19, 2006, 05:32:49 am
Is it possible to watermark thumbnails, too?

I think the watermark would not be readable if you downsize the watermark as much as the picture. So it would be nice to be able to downsize the watermark to a configurable width.
Title: Re: Permanant watermark with undo possibility (GD2+IMagick) + better admin tools
Post by: zerillos on September 19, 2006, 10:22:34 am
            
                                    
now just replace include/picmgmnt.inc.php with the attached one

Where is that ? ???
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Joachim Müller on September 19, 2006, 10:28:50 am
Attached to the very first posting. Read more carefully!
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: zerillos on September 19, 2006, 11:07:30 am
I'm sorry :D

Is there a mod to watermark the already uploaded images?
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: jerx on September 19, 2006, 12:14:42 pm
Read the first post more carefully!
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Joachim Müller on September 19, 2006, 04:06:10 pm
If you want old images to get the watermark too, then you have to run the admin tools. To make it more comfortable for you I've added an 'auto refresh' feature.
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Stramm on September 19, 2006, 07:27:44 pm
Is it possible to watermark thumbnails, too?

I think the watermark would not be readable if you downsize the watermark as much as the picture. So it would be nice to be able to downsize the watermark to a configurable width.

of course possible... but not useful for the majority of users. To watermark thumbs you need to change function add_picture
after
Code: [Select]
if (!file_exists($thumb)) {you need  add an if-else clause and when watermarking is turned on in config ->
Code: [Select]
            if (!resize_image($work_image, $thumb, $CONFIG['thumb_width'], $CONFIG['thumb_method'], $CONFIG['thumb_use'], "true", 1))
then in the function resize_image you look for
Code: [Select]
$wm_resize = (int)(($destWidth / $wm_normal) * 100);here you hardcode something like...
Code: [Select]
if($wm_resize < 100) $wm_resize = 100;

not tested but it should work

Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: b4uphotos on September 28, 2006, 06:06:06 pm
afraid to tell you sir/madem but i did everything fine and no error is coming

while  "nothing happened with this on mysite www.b4uphotos.com" with this changes after ""Updating thumbnails and/or resized images, please wait..." :( no error nothing came no watermark came

Sorry to say but its true with me.. kindly make a support to me
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Stramm on September 28, 2006, 07:51:52 pm
http://forum.coppermine-gallery.net/index.php?topic=29817.msg142838#msg142838
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: undeshila on October 10, 2006, 09:14:32 am
ive seen no atached file for 1.4.9 is it the same with the 1.4.8 one ?
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Stramm on October 10, 2006, 11:01:36 am
http://forum.coppermine-gallery.net/index.php?topic=29817.msg143122#msg143122
that file hasn't changed since 1.4.6... if you do not like the version number then download the current modpack and use its picmgmnt.inc.php
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: derperle on October 10, 2006, 12:33:00 pm
i have do all things you said.

but i get this errors:

Quote
/themes/graffity/theme.php

    * Notice line 333: Undefined index: TOPTEN_title

/util.php

    * Notice line 255: Undefined index: mini_pfx
    * Notice line 255: Undefined index: mini_pfx
    * Notice line 255: Undefined index: mini_pfx
    * Notice line 255: Undefined index: mini_pfx
    * Notice line 255: Undefined index: mini_pfx

/include/picmgmt.inc.php

    * Notice line 301: Undefined variable: crop
    * Warning line 436: touch() [function.touch]: Utime failed: Operation not permitted
    * Notice line 452: Undefined index: reduce_watermark
    * Warning line 516: chmod() [function.chmod]: Operation not permitted
    * Notice line 301: Undefined variable: crop
    * Warning line 436: touch() [function.touch]: Utime failed: Operation not permitted
    * Notice line 452: Undefined index: reduce_watermark
    * Warning line 516: chmod() [function.chmod]: Operation not permitted
    * Notice line 301: Undefined variable: crop
    * Warning line 436: touch() [function.touch]: Utime failed: Operation not permitted
    * Notice line 452: Undefined index: reduce_watermark
    * Warning line 516: chmod() [function.chmod]: Operation not permitted
    * Notice line 301: Undefined variable: crop
    * Warning line 436: touch() [function.touch]: Utime failed: Operation not permitted
    * Notice line 452: Undefined index: reduce_watermark
    * Warning line 516: chmod() [function.chmod]: Operation not permitted
    * Notice line 301: Undefined variable: crop
    * Warning line 436: touch() [function.touch]: Utime failed: Operation not permitted
    * Notice line 452: Undefined index: reduce_watermark
    * Warning line 516: chmod() [function.chmod]: Operation not permitted

can you help me???
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Stramm on October 10, 2006, 05:29:04 pm
link+testuser account please, make sure that user's allowed to upload pics
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: derperle on October 11, 2006, 11:08:29 am
ok.
now it works.
i dont know why but it works.

thank you for the hack.....  :) :) :) :)
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: derperle on October 11, 2006, 11:11:57 am
Oh one thing.
I dont want that the script makes orign_flie.jpg cause i dont need.
How can i disable this option??
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Stramm on October 11, 2006, 11:30:58 am
you'll have to modify picmgmnt.inc.php
delete
Code: [Select]
if (!file_exists($orig) && $CONFIG['enable_watermark'] == '1' && ($CONFIG['which_files_to_watermark'] == 'both' || $CONFIG['which_files_to_watermark'] == 'original'))  {
// if copy of full_sized doesn't exist and if watermark enabled and if fullsized pic watermark=true -> then we need a backup
if (!copy($image, $orig))
                return false;
else
$work_image = $orig;
}

not tested, no guarantee ;)
after that modification you're not able to undo the watermarking
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: RBasil on October 18, 2006, 12:06:03 am
Maybe I am missing something, but is there a download where I can just have the watermark option without having to download the entire mod pack? If so can someone point me in the right direction?
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Stramm on October 18, 2006, 04:34:32 am
no, you'll have to apply the changes manually
Title: SPLIT: Re: Permanant watermark with undo possibility (GD2+IM working!) + better
Post by: Joachim Müller on October 18, 2006, 08:36:24 am
An unrelated reply to this thread has been split and moved to the proper board cpg1.4 modpack by Stramm (http://forum.coppermine-gallery.net/index.php?board=86).

http://forum.coppermine-gallery.net/index.php?topic=37442.0 (http://forum.coppermine-gallery.net/index.php?topic=37442.0)
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: alanlai on October 26, 2006, 10:56:55 am
good mod.... thanks alot...

i wish the next version of gallery can have it build-in too...

thanks :)
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Stramm on October 26, 2006, 08:22:12 pm
already done
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: mattocean on November 06, 2006, 12:11:48 pm
Hi,

I am using Coppermine 1.4.x and changed every file you requested. Everything works fine, I can upload files but no watermark on them...

I set by the config

Image Watermarking Yes
Bottom right
Original
images/watermark.png
Transparency 50

and save the changes but nothing happens... after I run the config again all my previouse changings are empty...

Help! :)

Thanks! ;)
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Stramm on November 06, 2006, 12:46:02 pm
Read the first post in this thread again, especially the part with the setup instructions

Code: [Select]
Setup:
just apply the following code, replace include/picmgmnt.inc.php with the attached file and run update.php
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: mattocean on November 06, 2006, 01:19:35 pm
Read the first post in this thread again, especially the part with the setup instructions

Code: [Select]
Setup:
just apply the following code, replace include/picmgmnt.inc.php with the attached file and run update.php

Thanks a lot! It works ;D keep up the good work :)

a question again... the added watermark looks a bit compressed. The lines are a bit too smooth. Any idea why? I using transparent PNG file.

Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: kipper on November 06, 2006, 01:51:27 pm
Hi I am seriously missing something here about the install. Is the picmgmt.inc.zip a plugin? (it says not a plugin package when tried) and I can not see any detailed install instructions. Please forgive my daft questions while I get my head around coppermine operations (I am a phpBB board admin).

Thank you
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Stramm on November 06, 2006, 01:57:27 pm
a link would help... and of course the image gets recompressed. That's the whole idea of watermarking. You merge two pictures and then you save them as a new image... again with jpg compression. If the watermark is smaller on the intermediate image than expected, than that's a feature (if you applied it)

http://forum.coppermine-gallery.net/index.php?topic=29817.msg143122#msg143122

and what's not clear about
Code: [Select]
replace include/picmgmnt.inc.php with the attached filethis mod is in the mods board, we're not talking about plugins. picmgmnt.inc.php is a file in the include dir. Replace it with the attached one (unzip first)
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: oyabun on November 06, 2006, 03:22:42 pm
Hey there,

at first: nice mod, yesterday i installed it, then it worked without problems.

But for now (i installed another mods and a theme) my new uploaded images are not watermarked anymore...

Or did I forget any step after uploading & batch adding the pictures  ???
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Stramm on November 06, 2006, 06:42:34 pm
batch add: make sure you've properly modified searchnew.php (the last step to do)
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: rbh on November 06, 2006, 10:09:40 pm
good mod.... thanks alot...

i wish the next version of gallery can have it build-in too...

thanks :)
already done

what version will have this mod? i downloaded 1.4.10 and it wasnt there that i saw.
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Stramm on November 06, 2006, 11:30:22 pm
1.5
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: oyabun on November 06, 2006, 11:48:37 pm
@Stramm: Yep, I edited the files correct (i hope so). The Mod did already work, so that's what's strange for me ???
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Stramm on November 07, 2006, 11:38:27 am
if it worked before and suddenly stopped after you applied other mods?? then that may be the reason. An url may be helpful, also a testuser account (with the permission to upload). If http upload works but not batch adding, then read this thread and the modpack thread. Has been answered several times (permission problems... chmod to batch add dirs 777, files 666)
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: khm1972 on November 07, 2006, 11:49:24 am
I have just added the code, replaced the picmgmt.inc file and run update.php. Everything also seems to have been applied correctly when I enter config, but the system will not let me save the entered specifications under "Image watermarking" in Config.

Eg: I have written the full path for my watermark and marked the "Use watermark" button and then I push save to store the changes in Config. Then I get the ususal message that Config has been updated, but when I check "Image Watermarking" in Config again to see if informtion has been stored, it has returned back to default.

I am only using english language if that has any influence. 

Have I done anything wrong in the applying of code - if so witch file do I have to look at?

Thanks
Klaus
www.markussens.dk
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Stramm on November 07, 2006, 12:04:00 pm
if that happens, then the necessary SQL hasn't been aplied and updated properly.
- you haven't applied the code to sql/update.sql or you haven't uploaded the file
- you haven't run update.php (you say you have... do it again and check if the data you added to update.sql gets added)

language doesn't matter...only necessary to see the config settings
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: oyabun on November 08, 2006, 04:10:19 pm
Thanks, Stramm! The files had permission 777, after I changed it to 666 it worked :o

 ;)
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: khm1972 on November 08, 2006, 08:28:36 pm
Thanks that did the trick. However I still have a problem to solve so hopefully you can help me with that to. The problem is that now I am only able to upload Images where I have deselected the Watermark option. When I select Watermark image - the upload process ends somewhere at db_input.php and I get a "Lost network connection (NSURLErrorDomain:-1005)" on my Mac and a Zero Sized Reply on PC.

I have posted a question about this earlier since it also was a problem after installing the Modpack on another site of mine. See http://forum.coppermine-gallery.net/index.php?topic=38020.0. Here you suggest to increase the PHP memory limit but where do I do this? Is it something I am able to do my self of is it a job for my host. Seems like it could be the problem here also.

Thanks
Klaus


if that happens, then the necessary SQL hasn't been aplied and updated properly.
- you haven't applied the code to sql/update.sql or you haven't uploaded the file
- you haven't run update.php (you say you have... do it again and check if the data you added to update.sql gets added)

language doesn't matter...only necessary to see the config settings
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Stramm on November 09, 2006, 09:42:08 am
that's a job for your host to do (php.ini)
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: Toto - BOD on November 15, 2006, 09:25:13 am
First of all Hello and Congratulation for this mod!

After instaling this mod, i encounted a problem with the watermark! It`s not like it should be! Let me give you an exemple because is easyer for me:

This is my watermark:
http://i4.photobucket.com/albums/y124/toto_bad/logo2-2.jpg
And this is my foto after watermaking it:
http://i4.photobucket.com/albums/y124/toto_bad/IMG_38711-1.jpg


I didn`t set any transparecy and i tryed 2 diffrent paint programs but the watermark still looks like this! Can anyone help me!?

PS: PLEASE SCUZE MY ENGLISH, IT KIND OF BAD BUT I UNDERSTAND VERY WELL!
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Stramm on November 15, 2006, 12:38:24 pm
don't set any value for 'Set color transparent x,y'
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: Toto - BOD on November 15, 2006, 02:07:45 pm
I didn`t. that value it 0.

Should I install the MOD again? Can it be an instalation error?

Thanks for the reply!
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Stramm on November 15, 2006, 02:18:39 pm
don't set it to '0' set no value at all... as an alternative you could comment out a line in include/picmgmnt.inc.php
Code: [Select]
imagecolortransparent($logoImage, imagecolorat($logoImage, $CONFIG['watermark_transparency_featherx'], $CONFIG['watermark_transparency_feathery'])); replace with
Code: [Select]
//imagecolortransparent($logoImage, imagecolorat($logoImage, $CONFIG['watermark_transparency_featherx'], $CONFIG['watermark_transparency_feathery']));
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Stramm on November 15, 2006, 02:21:16 pm
and... use a png as watermark image (as stated in the docs - first post in this thread)
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: Toto - BOD on November 15, 2006, 04:42:44 pm
ok! i`ve done it and it works now! thanks for helping me! keep up the good work!
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: hyperionx on November 20, 2006, 12:18:14 pm
Just installed this hack, its a great one! thank you very much!
However, i have noticed a couple of small errors now during batch uploading. First when i open a folder the thumbs on the right does not show and when i upload the pics then the blue OK pic doesnt show on the right. Although the pictures works fine and are uploaded without a hassle this is still a little bit worrying.
So if someone know what this might be please advise me since im not an expert at this :)
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Stramm on November 20, 2006, 12:52:45 pm
from what has changed in the searchnew.php (batch add) I can tell you the 'small errors' you experience have nothing to do with the mod
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: hyperionx on November 20, 2006, 12:56:44 pm
alright thanks :), i'll try to look through it but i think i can live with them so. thanks again for a great mod!
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Stramm on November 20, 2006, 01:04:54 pm
sure, no problem at all... you always can seek support on the uploads troubleshooting board. Read the sticky thread and follow the instructions in the docs

http://coppermine-gallery.net/demo/cpg14x/docs/index.htm#upload_trouble

you also may want to search the board. I remember others having similar issues but don't remember the reason/ solution (probably memory etc.)
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: hyperionx on November 20, 2006, 01:05:44 pm
will do!, thanks :)
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: Niet on November 21, 2006, 10:29:01 pm
Works great with 1.4.9. Thanks  a lot  ;D
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: slausen on November 25, 2006, 08:16:49 pm
Hi-

This mod looks great but when I went to download it from Stramm's site (the modpack) I noticed there were many versions, with the latest version being marked as for CPG 1.4.10. I was just wondering if this latest version of the Stramm mod (with all the latest bugfixes) is backward compatible with previous versions of CPG or do I need to stick with an old version of the mod? I would prefer not to upgrade the entire CPG installation at this time.
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Joachim Müller on November 26, 2006, 10:45:59 am
Ask questions related to Stramm's modpack on the modpack support board (http://forum.coppermine-gallery.net/index.php?board=86.0) in the future, as this thread is not dedicated to the modpack, but the watermarking mod only!

To naswer your question: Yes, currently cpg1.4.10 is the most recent coppermine version. Subsequently, the corresponding modpack version is the most recent. In fact, version numbers are always counted upwards, so the highest number will always be the most recent.

If this doesn't answer your question to the full, please do as I suggested above and start a new thread on the proper board.

Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: Bacchus1 on December 01, 2006, 02:00:42 pm
Hello,

I uploaded this mod and I am having a problem. When I upload a pic I get this message:

The previous file could not be placed.

You have successfully placed all the files.

Then no pic gets uploaded.

Any ideas?

Alternatively, I am getting fed up trying to install this properly ... are there any reliable people who would help me get my album working? I am willing to pay.
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Stramm on December 01, 2006, 02:22:52 pm
Without a link and a testuser account it's hard to tell you anything.

Did uploading work on an unmodified CPG?
Did you follow all steps mentioned in the first post?

If you do not want to apply this mod... use the modpack. That's all premodded files. Just replace the original ones with these and basically you're done.

http://forum.coppermine-gallery.net/index.php?topic=28367.0
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Bacchus1 on December 01, 2006, 03:25:16 pm
album:

http://www.eastsidefreeride.com/coppermine/index.php

testuser:

simple1
simple2

CPG is unmodified. Follow all instructions. Tried installing a plugin from the mod pack but it didn't work either, and there is no support on the plugin any more ( CPGMark )

I want to apply this mod, I'm just very frustrated at my own inability to pull it off. It is starting to consume more hours than I have, and I am quite certain that there are people out there who could do this way more efficiently than I could.

Any help would be appreciated Stramm.
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Stramm on December 01, 2006, 03:33:04 pm
if you have the problems with an unmodified coppermine then you don't have it properly installed. Chmod the necessary folders as mentioned in the docs
http://coppermine-gallery.net/demo/cpg14x/docs/index.htm#how
especially the albums folder and its subfolders (edit)
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Bacchus1 on December 01, 2006, 03:54:40 pm
if you have the problems with an unmodified coppermine then you don't have it properly installed. Chmod the necessary folders as mentioned in the docs
http://coppermine-gallery.net/demo/cpg14x/docs/index.htm#how
especially the albums folder and its subfolders (edit)

Chmod has been done. I installed it as specified. The problem occured when I cut and pasted the mod lines from this thread. It included irregular blank spaces that gave me errors. So I replaced them and the error messages stoped. However, now the upload process won't work. Don't know why.
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Bacchus1 on December 01, 2006, 04:05:19 pm
before I added this mod everything worked well. The error is with my installation of this mod. If I had a pointer I could probably track this error down. However, I don't know which of the files I edited might influence the board in this way. In otherwords, I do not know where to begin.
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Stramm on December 01, 2006, 04:11:11 pm
So I guess somewhere you have not followed the instructions 100%. Where... I can't tell you. It can be nearly everywhere.

It also might be an invalid watermark image or the wrong path to it

As already said... it might be easier to use the modpack.
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Stramm on December 01, 2006, 04:13:14 pm
and you may wish to use the picmgmnt.inc.php from the modpack either way
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Bacchus1 on December 01, 2006, 05:06:26 pm
Ok, I just re-installed everything. The Chmod is set right. The file path is correct.

I will play with it a bit more to see what is up, but if I do give up what plugin are you writing about? The CPGmark? Is that my only option? Because if it is I've already had a miserable time with that plugin too.

As always, I appreciate all help.

Cheers!
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Bacchus1 on December 01, 2006, 06:05:45 pm
The original is getting uploaded and stored in the private folder, however, none of the other versions are being processed. No thumbs, no intermediate and no large. Any ideas?
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Stramm on December 01, 2006, 06:44:46 pm
check if you've set an image library that's actually installed on your server (GD2 <-> ImageMagick).

Modpack: it's premodded files that you just upload... read the thread above I've linked to. The modpack contains exactly this mod
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Bacchus1 on December 01, 2006, 07:14:45 pm
OK, I finally got it going. I moved the watermark in to the top layer (I originally had it in albums/watermarks/...) and it solved the issue. Now I want to mod the mod. I am running 1.4.9 Should I use picmgmnt.inc.1.4.6.zip ?




new attached file.... picmgmnt.inc.1.4.6.zip is the latest picmgmnt.inc.php file for CPG 1.4.6-1.4.8

Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Stramm on December 01, 2006, 07:25:37 pm
Quote
It also might be an invalid watermark image or the wrong path to it

Quote
and you may wish to use the picmgmnt.inc.php from the modpack either way
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Bacchus1 on December 01, 2006, 07:46:19 pm
Yes, thanks for bringing up the watermark location as a possible problem. That is why I tried changing it, and it worked.

I'm not too sure if you understood my last question, I want to mod your mod using this other mod of yours, which allows for resizing the watermark based on the size of the image.

It is this mod:

a mod for the mod...
Atm on all images (intermediate and fullsized) the same watermark gets applied. However it may look oversized on the intermediate. Now it's possible to let the watermark mod calculate a reduced watermark size for small images.

and I was wondering which picmgmt.inc.file I should use given that I am running 1.4.9. The picmgmt.inc.1.4.6 or just the picmgmt.inc  ?
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Stramm on December 01, 2006, 07:51:48 pm
hehehe... seems you don't want to understand me... use the picmgmnt.inc.php from the modpack.

or, if you do not want to download it, use the 1.4.6 one. The 'old' one without numbering is outdated
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Bacchus1 on December 01, 2006, 07:58:08 pm
Thanks for all your help Stramm. I assure you it isn't that I don't want tu understand you, but I don't know where this mod pack is. I DL a mod pack from the downloads tab, but I don't see any watermarking. It has just dawned on me, do you mean your stramm_mod1.4.10.bridge.1 pack?
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Stramm on December 01, 2006, 08:02:31 pm
yup

announcment thread, docs
http://forum.coppermine-gallery.net/index.php?topic=28367.0
download
http://stramm.st.funpic.org/displayimage.php?album=13&pos=1
support
http://forum.coppermine-gallery.net/index.php?board=86.0
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Bacchus1 on December 01, 2006, 08:15:58 pm
yup


download
http://stramm.st.funpic.org/displayimage.php?album=13&pos=1



I tried this link before, and even after signing up, I couldn't access this link.

Thanks for the heads up, I DL the proper file from your modpack. I will install it tonight. Hopefully it will all go well.
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Bacchus1 on December 07, 2006, 10:25:47 am
Hi Stramm,

Everything is working well. Really cool mod! Very functional.

One addition that could be made is the the uploader is given the option of what corner of the picture they would like the watermark applied to. This way, if there is something important in the default corner nothing will be obscured.

Also, if the uploader could rotate the image before it was burned (this one I'm sure would be very difficult.

Cheers!
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Bacchus1 on December 08, 2006, 10:20:49 am
Hi!
If it's not too hard, can you make an option in the config — watermark padding (in pixels)? I think it's important feature ;)

If you want padding around your logo I have found that the easiest way is to include the padding to your logo itself. Make sure that you have transparent space around your logo. I added a very small 1px grey spot in each corner of the transparencey to make sure that the padding actually worked, but you can experiement with the pixels and without them.
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: pcp20us on December 09, 2006, 08:28:05 am
Hi all

I am trying this water mark. I folloewed stramms instructions. As below. as stated in the orignal post.  I have down this but don't seem to have any watermark options( where does it place the watermark option to do the config.

I must be missing something !!

Pete
Setup:
just apply the following code, replace include/picmgmnt.inc.php with the attached file and run update.php

now have a look at your coppermine config. You'll need to modify the path to the watermark. Preset is a file watermark.png in the coppermine images folder. If that doesn't work for you, use the absolute path to the watermark image
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Stramm on December 09, 2006, 09:35:04 am
you've modified the file lang/english.php -> you will see the new config settings only when viewing the gallery in english US (or you add the necessary code to the lang file you actually use)
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: pcp20us on December 09, 2006, 11:55:36 am
Hello

What do you modify the lang/english.php file with. From reading the post i have modified the include/picmgmt.inc.php file, that is the only file in the zip that i downloaded ?? is there am english.php update i am missing

Pete
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: pcp20us on December 09, 2006, 12:29:36 pm
I missed all the other mods to other files. I have done all those but still cannot see the watermark !!

Pete
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Stramm on December 09, 2006, 12:59:43 pm
you have to do as described in post 1-3 in this thread http://forum.coppermine-gallery.net/index.php?topic=29817.msg137993#msg137993

picmgmnt.inc.php you do not modify... you just overwrite the existing one with the one in the archive.
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: debragrant on December 18, 2006, 02:45:20 pm
Quote
Parse error: parse error, unexpected T_DOUBLE_ARROW in /home/fhlinux182/h/helendallimore.diva-host.com/user/htdocs/gallery/lang/english.php on line 2076

what have I done wrong? I have updated all the pages (i think)
where does the watermark image have to go and in for .php file for the path to the image go.
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: debragrant on December 18, 2006, 03:04:19 pm
what have I done wrong? I have updated all the pages (i think)
where does the watermark image have to go and in for .php file for the path to the image go.

sorry error is below when accessing admin tools:

Code: [Select]
Parse error: parse error, unexpected T_DOUBLE_ARROW in /home/fhlinux182/h/helendallimore.diva-host.com/user/htdocs/gallery/util.php on line 500
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Stramm on December 18, 2006, 04:56:04 pm
review all changes you have done. Somewhere's a typo etc
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: pcp20us on December 19, 2006, 01:41:22 am
Nice work Stramm

This watermark works a treat. Can you send me your  php part of your brain, so i can code like a maniac.

Merry Xmas all

Pete
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Hein Traag on February 10, 2007, 01:08:06 pm
Hi Stramm,

i tried to implement this mod today. Edited all the nescesary files. Made a backup. Uploaded all files. Ran update.php. Placed my own watermark.png into images.

When i know go to Image Watermarking i set the watermark image to Yes. I save the configuration and check the image watermarking settings. It's back to No again. Any idea why ?

Also when i go to admin tools and run the update all sizes it resizes everthing to this size "." (ie as small as a dot).

Running 1.4.10 with an extensive list of plugins (might have something to with it)

Hein
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Stramm on February 10, 2007, 09:50:14 pm
plugins usually can't interfere... I'd say something went wrong when you modified the files. When config settings don't get saved... check if the SQL really got applied
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: MastiMasti on February 13, 2007, 05:21:45 am
Dear Stramm
work pretty nice I just INSTALL IT NOW
I did tried yesterday but I think I were missing something today backup and tried again
now it's work fine

10+ great work
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: cong on April 01, 2007, 01:59:39 am
hello

i have problem

i do all steps as you said in mod but after i applied the mod i can't access the admin tools page and i get this message
"There was an error while processing a database query "

and when i active image watermarking in config and click yes and after that when i go to config i found that  image watermarking is not active and mark "no" instead of yes

thank you stramm
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: cong on April 01, 2007, 03:08:33 am
i did steps again and now config page is ok and the mod work nice
i am beginner in php so i can't understand this step ( what exact code that i remove it and put this code )





replace the entire function update_thumbs() with


Code:
function update_thumbs()
{
        global $CONFIG, $lang_util_php;

        $albumid = (isset($_REQUEST['albumid'])) ? $_REQUEST['albumid'] : 0;
        $albstr = ($albumid) ? "WHERE aid = $albumid" : '';
        $autorefresh = $_REQUEST['autorefresh'];
        $updatetype = $_REQUEST['updatetype'];
        $numpics = $_REQUEST['numpics'];
        $startpic = (isset($_REQUEST['startpic'])) ? $_REQUEST['startpic'] : 0;

        echo "<h2>{$lang_util_php['thumbs_wait']}</h2>";

        $result = cpg_db_query("SELECT * FROM {$CONFIG['TABLE_PICTURES']} $albstr LIMIT $startpic, $numpics");
        $count = mysql_num_rows($result);

        while ($row = mysql_fetch_assoc($result)){

                $image = $CONFIG['fullpath'] . $row['filepath'] . $row['filename'];
                $normal = $CONFIG['fullpath'] . $row['filepath'] . $CONFIG['normal_pfx'] . $row['filename'];
                $thumb = $CONFIG['fullpath'] . $row['filepath'] . $CONFIG['thumb_pfx'] . $row['filename'];
                $mini = $CONFIG['fullpath'] . $row['filepath'] . $CONFIG['mini_pfx'] . $row['filename'];
            $orig=$CONFIG['fullpath'] . $row['filepath'] . $CONFIG['orig_pfx'] . $row['filename'];
            
            if (file_exists($orig)) {
               $work_image=$orig;
               $orig_true='true';
            } else {
               $work_image=$image;
               $orig_true='false';
            }
            
        $imagesize = getimagesize($work_image);
        if ($updatetype == 0 || $updatetype == 2 || $updatetype == 5)  {
            if (resize_image($work_image, $thumb, $CONFIG['thumb_width'], $CONFIG['thumb_method'], $CONFIG['thumb_use'], "false", 1)) {
                echo $thumb .' '. $lang_util_php['updated_succesfully'] . '!<br />';
                my_flush();
            } else {
                echo $lang_util_php['error_create'] . ':$thumb<br />';
                my_flush();
            }
           if ($CONFIG['enable_mini_thumbs'] == '1') {
               if (resize_image($work_image, $mini, $CONFIG['mini_thumb_width'], $CONFIG['thumb_method'], "mini", "false", 1)) {
                   echo $mini .' '. $lang_util_php['updated_succesfully'] . '!<br />';
                   my_flush();
               } else {
                   echo $lang_util_php['error_create'] . ':$mini<br />';
                   my_flush();
               }
         }
      }

        if ($updatetype == 1 || $updatetype == 2 || $updatetype == 3 || $updatetype == 5)
         {
            ($CONFIG['enable_watermark'] == '1' && $CONFIG['which_files_to_watermark'] == 'both' || $CONFIG['which_files_to_watermark'] == 'resized') ? $watermark="true" : $watermark="false";
            if (max($imagesize[0], $imagesize[1]) > $CONFIG['picture_width'] && $CONFIG['make_intermediate'])
            {
                if (resize_image($work_image, $normal, $CONFIG['picture_width'], $CONFIG['thumb_method'], $CONFIG['thumb_use'], $watermark))
               {
                    echo $normal . " " . $lang_util_php['updated_succesfully'] . '!<br />';
                    my_flush();
               }
                else
               {
                    echo $lang_util_php['error_create'] . ':$normal<br />';
                    my_flush();
                   }
               }
         }
        if ($updatetype == 3 || $updatetype == 4 || $updatetype == 5) 
         {
         ($CONFIG['thumb_use'] == "ex") ? $resize_method = "any" : $resize_method = $CONFIG['thumb_use'];

           if (((USER_IS_ADMIN && $CONFIG['auto_resize'] == 1) || (!USER_IS_ADMIN && $CONFIG['auto_resize'] > 0)) && max($imagesize[0], $imagesize[1]) > $CONFIG['max_upl_width_height']){ //$CONFIG['auto_resize']==1
            $max_size_size = $CONFIG['max_upl_width_height'];
         }
         else {
            $resize_method = "orig";
            $max_size_size = max($imagesize[0], $imagesize[1]);
         }
         if ($orig_true == 'false')
            {
            if (copy($image, $orig))
               {             
                    if ($CONFIG['enable_watermark'] == '1' && $CONFIG['which_files_to_watermark'] == 'both' || $CONFIG['which_files_to_watermark'] == 'original')
                     {
                        if (resize_image($work_image, $image, $max_size_size, $CONFIG['thumb_method'], $resize_method, 'true'))
                           {
                               echo $image . " " . $lang_util_php['updated_succesfully'] . '!<br />';
                               my_flush();
                           }
                            else
                           {
                                echo $lang_util_php['error_create'] . ':$image<br />';
                                my_flush();
                               }
                     }
               }
            } else {
                 if ($CONFIG['enable_watermark'] == '1' && $CONFIG['which_files_to_watermark'] == 'both' || $CONFIG['which_files_to_watermark'] == 'original')
                  {
                     if (resize_image($work_image, $image, $max_size_size, $CONFIG['thumb_method'], $resize_method, 'true'))
                        {
                            echo $image . " " . $lang_util_php['updated_succesfully'] . '!<br />';
                            my_flush();
                        }
                         else
                        {
                             echo $lang_util_php['error_create'] . ':$image<br />';
                             my_flush();
                            }
               } else {
                    if (((USER_IS_ADMIN && $CONFIG['auto_resize'] == 1) || (!USER_IS_ADMIN && $CONFIG['auto_resize'] > 0)) && max($imagesize[0], $imagesize[1]) > $CONFIG['max_upl_width_height']){
                     if (resize_image($work_image, $image, $max_size_size, $CONFIG['thumb_method'], $resize_method, 'false'))
                        {
                            echo $image . " " . $lang_util_php['updated_succesfully'] . '!<br />';
                            my_flush();
                        }
                         else
                        {
                             echo $lang_util_php['error_create'] . ':$image<br />';
                             my_flush();
                            }
                  } elseif (copy($orig, $image))
                     {
                          echo $orig . " " . $lang_util_php['updated_succesfully'] . '!<br />';
                          my_flush();
                     }
                      else
                     {
                          echo $lang_util_php['error_create'] . ':$image<br />';
                          my_flush();
                         }
                  }
               }
            }
          $imagesize = getimagesize($image);
      $query_up = "UPDATE {$CONFIG['TABLE_PICTURES']} SET pwidth='$imagesize[0]' , pheight='$imagesize[1]' WHERE pid='".$row['pid']."' ";
      cpg_db_query($query_up);
      }

        if ($count == $numpics){

                $startpic += $numpics;
            if($autorefresh) {
               echo <<< EOT
               <meta http-equiv="refresh" content="1; URL=util.php?numpics={$numpics}&startpic={$startpic}&albumid={$albumid}&autorefresh={$autorefresh}&action=update_thumbs&updatetype={$updatetype}">
EOT;
            }
            else
            {
                 echo <<< EOT
                   <form action="util.php" method="post">
                                   <input type="hidden" name="action" value="update_thumbs" />
                                   <input type="hidden" name="numpics" value="$numpics" />
                                   <input type="hidden" name="startpic" value="$startpic" />
                                   <input type="hidden" name="updatetype" value="$updatetype" />
                                   <input type="hidden" name="albumid" value="$albumid" />
                                   <input type="hidden" name="autorefresh" value="$autorefresh" />
                                   <input type="submit" value="{$lang_util_php['continue']}" class="button" />
                   </form>
EOT;
            }
        }
      else echo $lang_util_php['finished'];
}

function deletbackup_img()
{
        global $CONFIG, $lang_util_php;

        $albumid = (isset($_POST['albumid'])) ? $_POST['albumid'] : 0;
        $albstr = ($albumid) ? "WHERE aid = $albumid" : '';

        $result = cpg_db_query("SELECT * FROM {$CONFIG['TABLE_PICTURES']} $albstr");
        $num = mysql_num_rows($result);
    $i = 0;
    while ($i < $num) {
        $pid = mysql_result($result, $i, "pid");
        $back = $CONFIG['fullpath'] . mysql_result($result, $i, "filepath") . $CONFIG['orig_pfx'] . mysql_result($result, $i, "filename");

        if (file_exists($back)) {
         if(unlink($back)){
                printf("Success".$lang_util_php['main_success'], $back);
                print '!<br>';
            }
            } else {
                printf("Error".$lang_util_php['error_rename'], $back);
            }
        ++$i;
    }
}

Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: cong on April 01, 2007, 03:44:29 am
i solved all problems   8)
and the mod is very very very very gooooood
and you stramm is very very very goooood  ;D ;D
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: JJRuhle on April 08, 2007, 03:27:54 am
He says: "now just replace include/picmgmnt.inc.php with the attached one"

But there is no such file attached to his post. Where do I get it?
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: JJRuhle on April 08, 2007, 03:33:27 am
Nevermind... just found it attached to the first post, instead of the one it is mentioned in.
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: rajraj on May 14, 2007, 03:26:21 am
hi, i am new - just got the gallery and wondering how would i add watermaking mod to my cofig?

i notice in your instructions on 1st post to edit a code ...where is this code found, which i am supposed to edit to get watermark?

i got this gallery function on my website by installing it from my control panel from my hosting website - so its offered as standard you can say.

therefore i have no access - or i think i have no access to the code of my gallery.

please help me find this place where i am suppose to edit this code to make all my images secure with watermark as its vital for me.

also is this the latest and best solution we have so far - as it seems there have been soo many mods.

thanks

Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Stramm on May 14, 2007, 08:05:49 am
None of the supporters here know your server. What OS, what directory layout etc. Therefore we can't give you advice. Ask your webhost to find out. Sometimes it's enough to use a ftp client and to browse your server to find out.

This solution with some changes will be part of the next coppermine version. The latest version of that mod is always part of the modpack (found on the mods board also). The picmgmnt.inc.php file you can download in this thread isn't the latest version. You can use the one from the modpack.
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: LWAA on May 23, 2007, 09:54:11 pm
could you please tell me where to download the latest version of this?

thanks.
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Stramm on May 23, 2007, 10:00:41 pm
see sig
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: jw0ollard on May 30, 2007, 08:43:11 am
Can't you somehow put a chmod() command into one of the PHP files to automatically set the image permissions to 666?

I keep forgetting to chmod the files when using Batch Upload, and it's getting very annoying.

I've been trying this myself,  but I can't find where exactly to put the chmod() code.  ???
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Stramm on May 31, 2007, 06:25:45 pm
coppermine already does that (see config), however batch uploading is FTP, and the files you upload do not go through a php file. Just when you want to watermark them it's necessary. But without the necessary permission php only can read the files but not save them. You only can do that with your ftp client.
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: jw0ollard on June 03, 2007, 03:21:24 pm
You didn't understand what I was asking.  I'm aware of all that,  but what I'm asking is wouldn't it be more simple to actually write a chmod command into the PHP file that handles batch uploaded images?

http://www.php.net/chmod (http://www.php.net/chmod)

That way it would be automated and wouldn't require any chmodding through FTP.

Esp. read this comment: http://www.php.net/manual/en/function.chmod.php#73147 (http://www.php.net/manual/en/function.chmod.php#73147)

I'm not skilled enough with PHP to do this,  but surely if you were smart enough to write all the watermarking code, you'd know how to add a CHMOD command right into the PHP file?

Having to change file permissions every time I batch upload images is just NOT an option for me.
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Stramm on June 03, 2007, 08:15:42 pm
No, I guess you didn't understand me. If you upload by FTP and don't set the necessray permissions for php (GD2) or ImageMagick to edit a pic, then of course php (GD2) and ImageMagick won't have the permission to change permissions. Otherwise the entire permission system is useless.
If a user doesn't have the permission to edit, then he (it) can't edit. Doesn't matter if it's the file itself or its permissions.

You could change your setup, let php run under your account. Or upload as http or php or whatever account php's running under.
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: jw0ollard on June 04, 2007, 10:35:30 pm
Yeah,  I guess you are still not understanding me.   ???

If you actually followed the links I showed you in the last post,  you'd see that you're able to use PHP code to connect ****VIA FTP**** and change the file permissions on the fly. So this would in a sense "automate" the Batch Uploading process as it was originally intended,  instead of uploading, changing permissions, and then finally batch uploading in Coppermine.  No extra steps,  no extra hassle,  no constantly forgetting to change the damn file permissions after you upload.

So tell me again why this can't be done through PHP?  :)

Like I said before,  I'm not an advanced coder,  but I don't see any problem in running the CHMOD via FTP code in the PHP file directly before GD2 works its watermarking magic??  I assume that even using batch upload,  the "picmgmt.inc.php" file is still loaded for the watermarking, but I have no idea where to add the code.

If you could actually take the time and read the words I'm typing this time, instead of just brushing me off and telling me I'm wrong,  I'd appreciate it. Thank you.
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: jw0ollard on June 04, 2007, 10:41:51 pm
I guess there is no edit button??

Edit:

Also,  if you'd very closely read the link I'm referring to (http://www.php.net/manual/en/function.chmod.php#73147 (http://www.php.net/manual/en/function.chmod.php#73147)), you'll notice this person is using this CHMOD via PHP method for image watermarking :

Quote
Here's a version that works with PHP 5.x - I use this to watermark images on a shared server.
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Stramm on June 05, 2007, 04:43:12 pm
And you still didn't understand what I said. Coppermine chmods uploads (http) already (as mentioned above).
What you do is requesting a new feature (one that's neither implemented in Coppermine nor in this mod cause of possible php timeouts).

So what do you want me to tell you???
I won't implement something like that cause I consider it not practical?
No feature request in the mods board, there's already one dedicated to feature requests (board rules)?
Or should I say:
If you need it then code it. Not related to this mod.

I already toold you a possibility to get around that restriction (change your server setup).
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Joachim Müller on June 06, 2007, 04:30:51 pm
[ot]
@Stramm:
Hehe, that's funny - Stramm (one of the Coppermine dev team's most skilled PHP coders) being sent to the PHP documentation page by someone who appears not to have understood the permissions concept behind Lunix *giggle*.
Sorry, Thomas - simply couldn't resist ;D.

@jw0ollard: as Stramm suggested: you can't assign/edit permissions on something that you don't already have permissions on. The whole point of permissions is that users who don't have them can't get them. Someone who has the permissions already needs to grant the unprivileged user the permissions he needs. Subsequently: if the script doesn't have permissions to CHMOD, then there's no use to issue PHP's chmod() command. This is in no way related to this mod, but a matter of server setup. Ranting on this thread about possible unrelated mods is not a bright idea. Telling skilled PHP developers to read up the PHP documentation and even insisting on being right even though Stramm has explained things in detail is not a bright idea neither.

Now let's close this unrelated discussion and return to the subject of this thread itself: the watermarking mod.

[/ot]
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: jw0ollard on June 06, 2007, 11:19:52 pm
Dear GauGau,

Hehe, I'M NOT talking about the PHP CHMOD() COMMAND!  Jesus!

Could you please do your job, GauGau, instead of writing 185 words making fun of me? You obviously haven't read my posts.

Since you won't visit the freaking links I've posted here,  here's what I was referring to.

Code: [Select]
<?php
// Connect to the FTP to chmod the file via FTP

$ftpUserName 'username';
$ftpUserPass 'userpass';
$ftpServer 'ftp.example.com';

  
$ftpConn ftp_connect($ftpServer);
 
  if (!
$ftpConn) {
    die(
"Unable to connect to $ftpServer");
  }

if (@
ftp_login($conn_id$ftpUserName$ftpUserPass)) {
   echo 
"Connected as $ftpUserName @ $ftpServer";
}
else {
   echo 
"Couldn't connect as $ftpUserName";
   
ftp_close($ftpConn);
   die(
"Closed connection to $ftpServer");
}

//Now change permissions to 666 or whatever you need

echo ftp_chmod($ftpConn0666$ftpFilename) ? "CHMOD successful!" 'Error';

// do what you need here

//Now change permissions back to 644 or whatever
echo ftp_chmod($ftpConn0644$ftpFilename) ? "CHMOD successful!" 'Error';

// Close the connection
ftp_close($conn_id);
?>

Does that look like a chmod() command GauGau?? NO.  So, again,  please read the discussion again.

Just because you're both developers does NOT make you right on this.  Quit disregarding everything everyone ever says on this board just because you automatically think you're right.

Now,  I'm not saying that I was in fact right,  but I was TRYING to suggest that the FTP_CHMOD() commands could be used to make sure the images were set to 0666 during the Batch Upload process.  OK??

I appreciate Stramm for his input, and I understand why he thinks that such a thing could not be implemented,  but you,  GauGau,  can you please apologize to me for wasting 185 words on making fun of me for absolutely no reason? I did not once insist I was right about anything, but it was also painfully clear that Stramm had not followed the link because the first TWO of his posts are all referring to the chmod() command when I was in fact asking about the ftp_chmod() command.  OK?

It's not my fault that I had to reiterate what I was saying a dozen times. 

Anyway,  I'm certainly never suggesting things on this board again, and I don't feel like I could possibly get any help from a developer who acts like a child.

P.S. I fully understand the permissions concept behind "Lunix," GauGau.  *giggle*
----------------------------------------

Now, back on topic.  I've just noticed that changing the Transparency value in the Config doesn't actually do anything for me.  I installed it and then installed the upgrade for resizing watermarks, both correctly.  There is a 0.0001% chance that I followed the directions wrong, unless I'm a complete idiot like GauGau was implying.  :)

Tata! 
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Stramm on June 07, 2007, 01:06:04 am
Now, back on topic.  I've just noticed that changing the Transparency value in the Config doesn't actually do anything for me.  I installed it and then installed the upgrade for resizing watermarks, both correctly.  There is a 0.0001% chance that I followed the directions wrong, unless I'm a complete idiot like GauGau was implying.  :)

Tata! 

Just read the first post of this thread. It answers your question.
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Stramm on June 07, 2007, 01:36:32 am
Now a little word to your statement I haven't read what you've written. Of course I have. I admit that sometimes I do not quite understand what some people mean. However what you've written I understood without having to read it a second time.

1st post:
Quote
Can't you somehow put a chmod() command into one of the PHP files to automatically set the image permissions to 666?

I've answered that question and I can't give you another answer. Short explanation of permissions.

2nd post:
Quote
... but what I'm asking is wouldn't it be more simple to actually write a chmod command into the PHP file that handles batch uploaded images?

I answered that question too, that coppermine already chmods files but not the original you uploaded by FTP. Again I explained permissions.

and without further explaining your thoughts you've written
Quote
Esp. read this comment: http://www.php.net/manual/en/function.chmod.php#73147

Hmm, you've talked about php chmodding, now you introduce a link to php ftp commands. And as said without explaining what you want to do with it. I ignored that link cause it'll mean
a) you ask me to rewrite the batch upload process? But this is a watermark mod thread, not in any way related to modifying the batch uploading
b) the already mentioned timeout problems
c) ftp functions aren't enabled by default. Means 500% more support requests. My time is limited
d) again, batch uploading isn't related
 
3rd post:
Quote
Yeah,  I guess you are still not understanding me.   Huh

If you actually followed the links I showed you in the last post,  you'd see that you're able to use PHP code to connect ****VIA FTP**** and change the file permissions on the fly. So this would in a sense "automate" the Batch Uploading process as it was originally intended,  instead of uploading, changing permissions, and then finally batch uploading in Coppermine.  No extra steps,  no extra hassle,  no constantly forgetting to change the damn file permissions after you upload.

finally you explain what you mean and what shall I say... my fears came true, see my thought to your 2nd post. Again I answered your post.

So now tell me what was wrong with all my answers. If you reread what you've written you'll notice that your understanding of the permissions concept isn't really clear. At least I never was sure if you  got it. And as it looks like, GauGau is thinking the same. So he explained permissions again to you.

That he's making fun of me shouldn't be your concern. Neither GauGau nor I'm native english speaking (not difficult to see) so I now just assume you didn't get what he meant. In any case, calm down, no one here wanted to make fun of you but all tried to help you and answered your questions.

Still, my patience is limited so I'm out of this discusson.
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: jw0ollard on June 07, 2007, 03:20:16 am
Everything mean I said was directed towards GauGau.  No hard feelings toward you, Stramm. :)   No need to explain yourself, either.. I never thought anything you said was wrong.

I fully understand all of your reasoning about not including something like this.  I'm sorry my simple question/suggestion turned into an argument,  but I *could* tell that you weren't fully understanding me.  Sorry I wasn't more clear.

And about the Transparency option.   Sorry, didn't read the first post!  :)  I'll just remove the non-GD2 options then.  I'm setting up the CPG for someone else and it will only confuse them if I don't remove it.  This was also the reason I was asking about a way to make the Batch Upload process work better with your mod,  since I wasn't sure the person would know how to CHMOD files.
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: jackbremer on June 08, 2007, 04:32:55 pm
bloomin' marvellous!  ;D
I backed everything up, followed the instructions, and when I re-read them found I needed to access update.php - once I'd done that it was plain sailing!
Many thanks for a useful plugin - can't wait for this to be included in the core code by default.
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Gatsu on July 06, 2007, 11:24:02 pm
Hey! ok I thought I had this working I went into my config menu and the Image watermarking option was available and there was one in admin tools as well. Just the Settings don't get saved. I have re put in the code but this problem is still there. I put all my permissions for files to 644 Now I have tried to run the update.php but this is what I get:

$file); } } closedir($dir); return $thumbs; } elseif ($folder == $search_folder) { // Search folder is the same as coppermine images folder; just return the array return $thumbs; } else { // Search folder is the different; check for files in the given folder $results = array(); foreach ($thumbs as $thumb) { if (is_file($search_folder.$thumb['filename'])) { $results[] = array('filename' => $thumb['filename']); } } return $results; } } // ----------------------------- TEST FUNCTIONS ---------------------------- // function test_sql_connection() { global $errors, $CONFIG; if (! $connect_id = @mysql_connect($CONFIG['dbserver'], $CONFIG['dbuser'], $CONFIG['dbpass'])) { $errors .= "
Could not create a mySQL connection, please check the SQL values in include/config.inc.php

MySQL error was : " . mysql_error() . "

"; } elseif (! mysql_select_db($CONFIG['dbname'], $connect_id)) { $errors .= "
mySQL could not locate a database called '{$CONFIG['dbname']}' please check the value entered for this in include/config.inc.php

"; } } // ------------------------- HTML OUTPUT FUNCTIONS ------------------------- // // Moved to include/update.inc.php -- chtito // ------------------------- SQL QUERIES TO CREATE TABLES ------------------ // function update_tables() { global $errors, $CONFIG; //$PHP_SELF = $_SERVER['PHP_SELF']; $gallery_dir = strtr(dirname($_SERVER['PHP_SELF']), '\\', '/'); $gallery_url_prefix = 'http://' . $_SERVER['HTTP_HOST'] . $gallery_dir . (substr($gallery_dir, -1) == '/' ? '' : '/'); $db_update = 'sql/update.sql'; $sql_query = fread(fopen($db_update, 'r'), filesize($db_update)); // Update table prefix $sql_query = preg_replace('/CPG_/', $CONFIG['TABLE_PREFIX'], $sql_query); $sql_query = remove_remarks($sql_query); $sql_query = split_sql_file($sql_query, ';'); ?>
Performing Database Updates
"; if (@mysql_query($q)) { echo ""; } else { echo ""; } } echo "
$q   OK   Already Done
"; } // --------------------------------- MAIN CODE ----------------------------- // // The defaults values $table_prefix = $_POST['table_prefix']; $DFLT = array('lck_f' => 'install.lock', // Name of install lock file 'cfg_d' => 'include', // The config file dir 'cfg_f' => 'include/config.inc.php', // The config file name 'alb_d' => 'albums', // The album dir 'upl_d' => 'userpics' // The uploaded pic dir ); $errors = ''; $notes = ''; // The installer html_header("Coppermine - Upgrade"); html_logo(); test_fs(); if ($errors != '') html_prereq_errors($errors); else { test_sql_connection(); if ($errors == '') { update_tables(); update_system_thumbs(); } else { html_error($errors); } if ($errors == '') { html_install_success($notes); } else { html_error($errors); } } html_footer(); ?>

Do you think I did something wrong?
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Stramm on July 07, 2007, 12:26:11 am
Have you carefully read the first post of this thread? And is there a reason for the code mess you posted?

Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Gatsu on July 07, 2007, 02:32:36 am
I'm sorry I will use simple words.

I followed everything
I repeat everything

problem:
Watermark Config not save.
Update.php not work.

Update.php result:
Code: [Select]
Server error!

The server encountered an internal error and was unable to complete your request.

Error message:
Premature end of script headers: update.php

If you think this is a server error, please contact the webmaster.
Error 500
family.philthurston.net
Sat Jul 7 03:18:52 2007
Apache/2.0.54 (Debian GNU/Linux) mod_auth_pgsql/2.0.2b1 mod_ssl/2.0.54 OpenSSL/0.9.7e

sql/update.sql= yes updated

Yes I read 1st post
again and again and again

Code mess was update.php from FTP interface
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Stramm on July 07, 2007, 08:00:05 am
Make sure your changes to update.sql match the instructions. Reupload sql/update.sql and update.php (from the coppermine package). Make sure you overwrite the files and do not append.
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Gatsu on July 09, 2007, 04:15:29 am
Thank you

It works

I forget most users are german

New Problem:

ImageMagick is supported on my webhost but is not core. I change ImageMagick settings in config menu. it not work. I know there is no support for imagemagick here.

Do you know of a program to change http://family.philthurston.net/images/sitelogosmall.png  (http://family.philthurston.net/images/sitelogosmall.png) to 49% Transparency?
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Stramm on July 09, 2007, 07:30:32 am
Every image editing should be able to do that (layer transparency). Photoshop, Gimp, Corel Paint ...
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: AvrilBoi on July 10, 2007, 03:23:14 pm
Oh one thing.
I dont want that the script makes orign_flie.jpg cause i dont need.
How can i disable this option??
you'll have to modify picmgmnt.inc.php
delete
Code: [Select]
if (!file_exists($orig) && $CONFIG['enable_watermark'] == '1' && ($CONFIG['which_files_to_watermark'] == 'both' || $CONFIG['which_files_to_watermark'] == 'original'))  {
// if copy of full_sized doesn't exist and if watermark enabled and if fullsized pic watermark=true -> then we need a backup
if (!copy($image, $orig))
                return false;
else
$work_image = $orig;
}

not tested, no guarantee ;)
after that modification you're not able to undo the watermarking
I still get the orig_ file saved in the album folder... Could you please look better into it? I really don't want that file to be saved :-[
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Stramm on July 10, 2007, 05:58:26 pm
have you read my posting??
Quote
... not tested, no guarantee ...

however, if you really did as said and you deleted that code, then no backup file will be created for all files uploaded after that modification. Test that. To get rid of the backup images for pics uploaded before the modification... use the shell (if you o not know how to do that -> google).

 
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: AvrilBoi on July 10, 2007, 06:58:00 pm
Sorry, I didn't specify one important thing.
I am watermarking old files with the admin utility, I didn't try to upload new files yet. So it is through the admin utility that the orig_ file gets saved, and I don't want it to be saved.
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Stramm on July 10, 2007, 07:21:50 pm
The code modification doesn't create new backup images. If they already are on your server do what I've posted above and delete the orig_ files using the shell. The admin tools won't delete them.

http://man.linuxquestions.org/index.php?query=rm&section=0&type=2
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: AvrilBoi on July 10, 2007, 08:49:52 pm
I think it creates orig_ files instead.
The old albums contain unwatermarked images. After I watermark them, in the directory of files there are the orig_* files. So before deleting the orig_files using the shell, I'd like the admin utility not to create them.
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Stramm on July 10, 2007, 09:27:08 pm
upload a test file, check if you've made the changes and if you've overwritten include/picmgmnt.inc.php with your modified version

post a link and a testuser account, zip up and attach your picmgmnt.inc.php with your next post
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: AvrilBoi on July 10, 2007, 11:19:09 pm
I PMed you with all the necessary info.
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Stramm on July 11, 2007, 08:16:13 am
A nonadmin testuser account is enough. I do not need to batch add cause it's using the same functions as the http upload. If that works as expected, then the batch add does the same. Before I can test, you should get it installed properly. I'm getting errors when trying to http upload -> search the board for that.
Your modified picmgmnt.inc.php looks OK, means it can't create backup images anymore. The necessary command is gone. If you replaced the one on the server with the one you sent me, all should be smooth. Then you just need to delete old backup images from your server. As already said two times, not with the admin tools but using the shell.
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: AvrilBoi on July 11, 2007, 12:53:51 pm
But I just need it to watermark old albums, since the images I'm going to upload are already watermarked. That's why I need to use the admin tool to watermark old albums...
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Stramm on July 11, 2007, 01:09:53 pm
We're talking here about the backup images?? Don't we
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: ashbash85 on July 16, 2007, 07:59:57 am
Hi, this is my first post on the forum so please forgive me if i've missed somebody else's reply to the same question.

I was using a version of coppermine gallery, 1.4.10 without this addin, I have not upgraded to version 1.4.12 and I've applied the mod to it. However I cannot get the images added tot he gallery before the mod was applied to watermark. If I upload a new image, or several into an album and then run the resize admin tool it works fine. But if I run the same on an old album it wont add the watermark.

Hope that makes sense,

Thanks

Ash  :)
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: Elwood J. Blues on August 05, 2007, 08:39:42 pm
Hello,

How can I add the username on the picture and the watermark ?

Thanks


PS : Sorry for my poor English, I'm French....
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Stramm on August 05, 2007, 09:05:38 pm
That's not a feature of this mod. You'll have to code it.
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: Elwood J. Blues on August 05, 2007, 09:28:49 pm
ok thank you  ;)
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: toe on August 19, 2007, 12:36:09 pm
Hi,

first I must say that I love the idea of watermarks and the way you're helping us :)

I tried to get the watermarks work but I came to a problem.

I've changed and uploaded all the files I had to. In the gallery setting i have the 'image watermarking'. If i set it to yes and save the setting, those setting return to previous where the watermarking was set to 'no' even though i have saved them.

Does any of you know what's wrong?

I was thinking the thing could be the language. Instead of changing the english one i've changed slovenian. Could that be it?
After this problem I also changed the english file, but my gallery setting wont let me switch the language so I can't check if it works there.

Thanks for your help
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Stramm on August 19, 2007, 09:43:01 pm
Quote
Setup:
just apply the following code, replace include/picmgmnt.inc.php with the attached file and run update.php
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: toe on August 20, 2007, 02:16:01 pm
Thanks! Took me some time to figure out what actually means to run updat.php but i did it. It works perfect now :D

Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: zoti on September 09, 2007, 08:21:08 am
I have installed the maintenance release cpg1.4.12 and it removed the watermark functionality. It doesn't show up in the config screen anymore and new images are not getting watermarked. Is there a fix?
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Stramm on September 09, 2007, 08:58:35 am
If you overwrite modded files with fresh, unmodded ones, then of course you'll have to reapply the code changes. That's the downside of modding. Upgrading's getting harder.
You could use the modpack. It contains the watermark mod as well as a bunch of other ones. It's premodded code. You upgrade as usual, then you upload the modpack (as you did with your original CPG files) and run again update.php.
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: zoti on September 09, 2007, 08:40:39 pm
If you overwrite modded files with fresh, unmodded ones, then of course you'll have to reapply the code changes. That's the downside of modding. Upgrading's getting harder.
You could use the modpack. It contains the watermark mod as well as a bunch of other ones. It's premodded code. You upgrade as usual, then you upload the modpack (as you did with your original CPG files) and run again update.php.

That is what I did but I got the error in the next reply ->

Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: zoti on September 09, 2007, 08:41:32 pm
---------------

Template error
Failed to find block 'my_friends'(#(<!-- BEGIN my_friends -->)(.*?)(<!-- END my_friends -->)#s) in :

                        <table border="0" cellpadding="0" cellspacing="0">
                                <tr>
<!-- BEGIN home -->
                                        <td><img name="spacer" src="images/spacer.gif" width="5" height="25" border="0" alt="" /></td>
                                        <td><img name="buttonleftmy" src="themes/hardwired/images/buttonleftmy.gif" width="17" height="25" border="0" alt="" /></td>
                                        <td style="background: url(themes/hardwired/images/buttoncenter.gif);">
                                                <a href="{HOME_TGT}" title="{HOME_TITLE}">{HOME_LNK}</a>
                                        </td>
                                        <td><img name="buttonright" src="themes/hardwired/images/buttonright.gif" width="7" height="25" border="0"  alt="" /></td>
<!-- END home -->
<!-- BEGIN my_gallery -->
                                        <td><img name="spacer" src="images/spacer.gif" width="5" height="25" border="0" alt="" /></td>
                                        <td><img name="buttonleftmy" src="themes/hardwired/images/buttonleftmy.gif" width="17" height="25" border="0" alt="" /></td>
                                        <td style="background: url(themes/hardwired/images/buttoncenter.gif);">
                                                <a href="{MY_GAL_TGT}" title="{MY_GAL_TITLE}">{MY_GAL_LNK}</a>
                                        </td>
                                        <td><img name="buttonright" src="themes/hardwired/images/buttonright.gif" width="7" height="25" border="0"  alt="" /></td>
<!-- END my_gallery -->
<!-- BEGIN allow_memberlist -->
                                        <td><img name="spacer" src="images/spacer.gif" width="5" height="25" border="0" alt="" /></td>
                                        <td><img name="buttonleft" src="themes/hardwired/images/buttonleftmemb.gif" width="17" height="25" border="0" alt="" /></td>
                                        <td style="background: url(themes/hardwired/images/buttoncenter.gif);">
                                                <a href="{MEMBERLIST_TGT}" title="{MEMBERLIST_TITLE}">{MEMBERLIST_LNK}</a>
                                        </td>
                                        <td><img name="buttonright" src="themes/hardwired/images/buttonright.gif" width="7" height="25" border="0"  alt="" /></td>
<!-- END allow_memberlist -->
<!-- BEGIN my_profile -->
                                        <td><img name="spacer" src="images/spacer.gif" width="5" height="25" border="0" alt="" /></td>
                                        <td><img name="buttonleft" src="themes/hardwired/images/buttonleft.gif" width="17" height="25" border="0" alt="" /></td>
                                        <td style="background: url(themes/hardwired/images/buttoncenter.gif);">
                                                <a href="{MY_PROF_TGT}" title="{MY_PROF_LNK}">{MY_PROF_LNK}</a>
                                        </td>
                                        <td><img name="buttonright" src="themes/hardwired/images/buttonright.gif" width="7" height="25" border="0"  alt="" /></td>
<!-- END my_profile -->
<!-- BEGIN faq -->
                                        <td><img name="spacer" src="images/spacer.gif" width="5" height="25" border="0" alt="" /></td>
                                        <td><img name="buttonleft" src="themes/hardwired/images/buttonleftfaq.gif" width="17" height="25" border="0" alt="" /></td>
                                        <td style="background: url(themes/hardwired/images/buttoncenter.gif);">
                                        <a href="{FAQ_TGT}" title="{FAQ_TITLE}">{FAQ_LNK}</a>
                                        </td>
                                        <td><img name="buttonright" src="themes/hardwired/images/buttonright.gif" width="7" height="25" border="0"  alt="" /></td>
<!-- END faq -->

<!-- BEGIN leave_admin_mode -->
                                        <td><img name="spacer" src="images/spacer.gif" width="5" height="25" border="0" alt="" /></td>
                                        <td><img name="buttonleftad" src="themes/hardwired/images/buttonleftad.gif" width="17" height="25" border="0" alt="" /></td>
                                        <td style="background: url(themes/hardwired/images/buttoncenter.gif);">
                                                <a href="{USR_MODE_TGT}" title="{USR_MODE_TITLE}">{USR_MODE_LNK}</a>
                                        </td>
                                        <td><img name="buttonright" src="themes/hardwired/images/buttonright.gif" width="7" height="25" border="0" alt="" /></td>
<!-- END leave_admin_mode -->
<!-- BEGIN upload_pic -->
                                        <td><img name="spacer" src="images/spacer.gif" width="5" height="25" border="0" alt="" /></td>
                                        <td><img name="buttonleftup" src="themes/hardwired/images/buttonleftup.gif" width="17" height="25" border="0" alt="" /></td>
                                       <td style="background: url(themes/hardwired/images/buttoncenter.gif);">
                                                <a href="{UPL_PIC_TGT}" title="{UPL_PIC_TITLE}">{UPL_PIC_LNK}</a>
                                        </td>
                                        <td><img name="buttonright" src="themes/hardwired/images/buttonright.gif" width="7" height="25" border="0"  alt="" /></td>
<!-- END upload_pic -->
<!-- BEGIN register -->
                                        <td><img name="spacer" src="images/spacer.gif" width="5" height="25" border="0" alt="" /></td>
                                        <td><img name="buttonleft" src="themes/hardwired/images/buttonleft.gif" width="17" height="25" border="0" alt="" /></td>
                                        <td style="background: url(themes/hardwired/images/buttoncenter.gif);">
                                                <a href="{REGISTER_TGT}" title="{REGISTER_TITLE}">{REGISTER_LNK}</a>
                                        </td>
                                        <td><img name="buttonright" src="themes/hardwired/images/buttonright.gif" width="7" height="25" border="0"  alt="" /></td>
<!-- END register -->

<!-- BEGIN logout -->
                                        <td><img name="spacer" src="images/spacer.gif" width="5" height="25" border="0" alt="" /></td>
                                        <td><img name="buttonleftout" src="themes/hardwired/images/buttonleftout.gif" width="17" height="25" border="0" alt="" /></td>
                                        <td style="background: url(themes/hardwired/images/buttoncenter.gif);">
                                                <a href="{LOGOUT_TGT}" title="{LOGOUT_LNK}">{LOGOUT_LNK}</a>
                                        </td>
                                        <td><img name="buttonright" src="themes/hardwired/images/buttonright.gif" width="7" height="25" border="0" alt="" /></td>
<!-- END logout -->
                                </tr>
                        </table>

-------------------------

Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: zoti on September 09, 2007, 08:42:18 pm
This is after I run update.php (which is already in the directory. Your mod doesn't have one in it, right?) and I get the following:

-------------------------

 
Performing Database Updates
CREATE TABLE IF NOT EXISTS cpg1410_sessions ( session_id varchar(40) NOT NULL default '', user_id int(11) default '0', time int(11) default NULL, remember int(1) default '0', PRIMARY KEY (session_id) ) TYPE=MyISAM COMMENT='Used to store sessions' OK
CREATE TABLE IF NOT EXISTS cpg1410_filetypes ( extension char(7) NOT NULL default '', mime char(30) default NULL, content char(15) default NULL, KEY extension (extension) ) TYPE=MyISAM COMMENT='Used to store the file extensions' OK
ALTER TABLE `cpg1410_filetypes` DROP INDEX `EXTENSION`, ADD PRIMARY KEY ( `extension` ) Already Done
ALTER TABLE `cpg1410_filetypes` ADD `player` VARCHAR( 5 )  Already Done
INSERT INTO cpg1410_filetypes VALUES ('jpg', 'image/jpg', 'image', '') Already Done
INSERT INTO cpg1410_filetypes VALUES ('jpeg', 'image/jpeg', 'image', '') Already Done
INSERT INTO cpg1410_filetypes VALUES ('jpe', 'image/jpe', 'image', '') Already Done
INSERT INTO cpg1410_filetypes VALUES ('gif', 'image/gif', 'image', '') Already Done
INSERT INTO cpg1410_filetypes VALUES ('png', 'image/png', 'image', '') Already Done
INSERT INTO cpg1410_filetypes VALUES ('psd', 'image/psd', 'image', '') Already Done
INSERT INTO cpg1410_filetypes VALUES ('bmp', 'image/bmp', 'image', '') Already Done
INSERT INTO cpg1410_filetypes VALUES ('jpc', 'image/jpc', 'image', '') Already Done
INSERT INTO cpg1410_filetypes VALUES ('jp2', 'image/jp2', 'image', '') Already Done
INSERT INTO cpg1410_filetypes VALUES ('jpx', 'image/jpx', 'image', '') Already Done
INSERT INTO cpg1410_filetypes VALUES ('jb2', 'image/jb2', 'image', '') Already Done
INSERT INTO cpg1410_filetypes VALUES ('swc', 'image/swc', 'image', '') Already Done
INSERT INTO cpg1410_filetypes VALUES ('iff', 'image/iff', 'image', '') Already Done
UPDATE cpg1410_config SET value='ALL' WHERE name='allowed_img_types' OK
INSERT INTO cpg1410_filetypes VALUES ('asf', 'video/x-ms-asf', 'movie', 'WMP') Already Done
INSERT INTO cpg1410_filetypes VALUES ('asx', 'video/x-ms-asx', 'movie', 'WMP') Already Done
INSERT INTO cpg1410_filetypes VALUES ('mpg', 'video/mpeg', 'movie', 'WMP') Already Done
INSERT INTO cpg1410_filetypes VALUES ('mpeg', 'video/mpeg', 'movie', 'WMP') Already Done
INSERT INTO cpg1410_filetypes VALUES ('wmv', 'video/x-ms-wmv', 'movie', 'WMP') Already Done
INSERT INTO cpg1410_filetypes VALUES ('swf', 'application/x-shockwave-flash', 'movie', 'SWF') Already Done
INSERT INTO cpg1410_filetypes VALUES ('avi', 'video/avi', 'movie', 'WMP') Already Done
INSERT INTO cpg1410_filetypes VALUES ('mov', 'video/quicktime', 'movie', 'QT') Already Done
INSERT INTO cpg1410_config VALUES ('allowed_mov_types', 'ALL') Already Done
INSERT INTO cpg1410_filetypes VALUES ('mp3', 'audio/mpeg3', 'audio', 'WMP') Already Done
INSERT INTO cpg1410_filetypes VALUES ('midi', 'audio/midi', 'audio', 'WMP') Already Done
INSERT INTO cpg1410_filetypes VALUES ('mid', 'audio/midi', 'audio', 'WMP') Already Done
INSERT INTO cpg1410_filetypes VALUES ('wma', 'audio/x-ms-wma', 'audio', 'WMP') Already Done
INSERT INTO cpg1410_filetypes VALUES ('wav', 'audio/wav', 'audio', 'WMP') Already Done
INSERT INTO cpg1410_filetypes VALUES ('ogg', 'audio/ogg', 'audio', '') Already Done
INSERT INTO cpg1410_config VALUES ('allowed_snd_types', 'ALL') Already Done
INSERT INTO cpg1410_filetypes VALUES ('ram', 'audio/x-pn-realaudio', 'document', 'RMP') Already Done
INSERT INTO cpg1410_filetypes VALUES ('ra', 'audio/x-realaudio', 'document', 'RMP') Already Done
INSERT INTO cpg1410_filetypes VALUES ('rm', 'audio/x-realmedia', 'document', 'RMP') Already Done
INSERT INTO cpg1410_filetypes VALUES ('tiff', 'image/tiff', 'document', '') Already Done
INSERT INTO cpg1410_filetypes VALUES ('tif', 'image/tif', 'document', '') Already Done
INSERT INTO cpg1410_filetypes VALUES ('doc', 'application/msword', 'document', '') Already Done
INSERT INTO cpg1410_filetypes VALUES ('txt', 'text/plain', 'document', '') Already Done
INSERT INTO cpg1410_filetypes VALUES ('rtf', 'text/richtext', 'document', '') Already Done
INSERT INTO cpg1410_filetypes VALUES ('pdf', 'application/pdf', 'document', '') Already Done
INSERT INTO cpg1410_filetypes VALUES ('xls', 'application/excel', 'document', '') Already Done
INSERT INTO cpg1410_filetypes VALUES ('pps', 'application/powerpoint', 'document', '') Already Done
INSERT INTO cpg1410_filetypes VALUES ('ppt', 'application/powerpoint', 'document', '') Already Done
INSERT INTO cpg1410_filetypes VALUES ('zip', 'application/zip', 'document', '') Already Done
INSERT INTO cpg1410_filetypes VALUES ('rar', 'application/rar', 'document', '') Already Done
INSERT INTO cpg1410_filetypes VALUES ('gz', 'application/gz', 'document', '') Already Done
INSERT INTO cpg1410_filetypes VALUES ('mdb', 'application/msaccess', 'document', '') Already Done
INSERT INTO cpg1410_config VALUES ('allowed_doc_types', 'ALL') Already Done
UPDATE cpg1410_filetypes SET player='WMP' WHERE extension IN ('asf','asx','mpg','mpeg','wmv','avi','mp3','midi','mid','wma','wav') OK
UPDATE cpg1410_filetypes SET player='QT' WHERE extension IN ('mov') OK
UPDATE cpg1410_filetypes SET player='RMP' WHERE extension IN ('ra','ram','rm') OK
UPDATE cpg1410_filetypes SET player='SWF' WHERE extension IN ('swc','swf') OK
ALTER TABLE cpg1410_comments add msg_raw_ip tinytext Already Done
ALTER TABLE cpg1410_comments add msg_hdr_ip tinytext Already Done
ALTER TABLE cpg1410_pictures add pic_raw_ip tinytext Already Done
ALTER TABLE cpg1410_pictures add pic_hdr_ip tinytext Already Done
INSERT INTO cpg1410_config VALUES ('thumb_use', 'any') Already Done
INSERT INTO cpg1410_config VALUES ('show_private', '0') Already Done
INSERT INTO cpg1410_config VALUES ('first_level', '1') Already Done
INSERT INTO cpg1410_config VALUES ('display_film_strip', '1') Already Done
INSERT INTO cpg1410_config VALUES ('display_film_strip_filename', '0') Already Done
INSERT INTO cpg1410_config VALUES ('max_film_strip_items', '5') Already Done
INSERT INTO cpg1410_config VALUES ('read_iptc_data', '0') Already Done
INSERT INTO cpg1410_config VALUES ('display_uploader', '0') Already Done
INSERT INTO cpg1410_config VALUES ('display_filename','0') Already Done
INSERT INTO cpg1410_config VALUES ('reg_notify_admin_email', '0') Already Done
INSERT INTO cpg1410_config VALUES ('disable_comment_flood_protect', '0') Already Done
INSERT INTO cpg1410_config VALUES ('upl_notify_admin_email', '0') Already Done
INSERT INTO cpg1410_config VALUES ('language_list', '0') Already Done
INSERT INTO cpg1410_config VALUES ('language_flags', '0') Already Done
INSERT INTO cpg1410_config VALUES ('theme_list', '0') Already Done
INSERT INTO cpg1410_config VALUES ('language_reset', '1') Already Done
INSERT INTO cpg1410_config VALUES ('theme_reset', '1') Already Done
INSERT INTO cpg1410_config VALUES ('offline', '0') Already Done
INSERT INTO cpg1410_config VALUES ('vanity_block','1') Already Done
INSERT INTO cpg1410_config VALUES ('allow_memberlist', '0') Already Done
INSERT INTO cpg1410_config VALUES ('display_faq', '0') Already Done
INSERT INTO cpg1410_config VALUES ('views_in_thumbview', '1') Already Done
INSERT INTO cpg1410_config VALUES ('show_bbcode_help', '1') Already Done
INSERT INTO cpg1410_config VALUES ('log_ecards', '0') Already Done
INSERT INTO cpg1410_config VALUES ('email_comment_notification', '0') Already Done
INSERT INTO cpg1410_config VALUES ('enable_zipdownload', '1') Already Done
INSERT INTO cpg1410_config VALUES ('debug_notice', '0') Already Done
INSERT INTO cpg1410_config VALUES ('slideshow_interval', '5000') Already Done
INSERT INTO cpg1410_config VALUES ('log_mode', '0') Already Done
INSERT INTO cpg1410_config VALUES ('media_autostart', '1') Already Done
INSERT INTO cpg1410_config VALUES ('enable_encrypted_passwords','0') Already Done
ALTER TABLE `cpg1410_categories` ADD `thumb` INT NOT NULL AFTER `parent`  Already Done
ALTER TABLE `cpg1410_albums` ADD `keyword` VARCHAR( 50 ) NOT NULL  Already Done
CREATE TABLE cpg1410_banned ( ban_id int(11) NOT NULL auto_increment, user_id int(11) DEFAULT NULL, ip_addr tinytext, expiry datetime DEFAULT NULL, PRIMARY KEY (ban_id) ) TYPE=MyISAM Already Done
CREATE TABLE cpg1410_exif ( `filename` varchar(255) NOT NULL default '', `exifData` text NOT NULL, UNIQUE KEY `filename` (`filename`) ) TYPE=MyISAM Already Done
CREATE TABLE cpg1410_ecards ( eid int(11) NOT NULL auto_increment, sender_name varchar(50) NOT NULL default '', sender_email text NOT NULL, recipient_name varchar(50) NOT NULL default '', recipient_email text NOT NULL, link text NOT NULL, date tinytext NOT NULL, sender_ip tinytext NOT NULL, PRIMARY KEY (eid) ) TYPE=MyISAM COMMENT='Used to log ecards' Already Done
ALTER TABLE `cpg1410_usergroups` ADD `upload_form_config` TINYINT(4) DEFAULT '3' NOT NULL Already Done
ALTER TABLE `cpg1410_usergroups` ADD `custom_user_upload` TINYINT(4) DEFAULT '0' NOT NULL Already Done
ALTER TABLE `cpg1410_usergroups` ADD `num_file_upload` TINYINT(4) DEFAULT '5' NOT NULL Already Done
ALTER TABLE `cpg1410_usergroups` ADD `num_URI_upload` TINYINT(4) DEFAULT '3' NOT NULL Already Done
CREATE TABLE IF NOT EXISTS `cpg1410_temp_data` ( `unique_ID` CHAR( 8 ) NOT NULL , `encoded_string` BLOB NOT NULL , `timestamp` INT( 11 ) UNSIGNED NOT NULL , PRIMARY KEY ( `unique_ID` ) ) TYPE = MYISAM COMMENT = 'Holds temporary file data for multiple file uploads' OK
UPDATE `cpg1410_config` SET value='classic' WHERE (name='theme' AND value='default') OK
DELETE FROM `cpg1410_filetypes` WHERE mime='text/html' OK
UPDATE `cpg1410_config` SET value='$/\\\\:*?"\'<>|` &' WHERE name='forbiden_fname_char' OK
ALTER TABLE `cpg1410_users` CHANGE user_lang user_group_list varchar(255) NOT NULL default '' Already Done
ALTER TABLE cpg1410_pictures DROP INDEX `owner_id` OK
ALTER TABLE cpg1410_pictures DROP INDEX `owner_id_2` Already Done
ALTER TABLE cpg1410_pictures ADD INDEX owner_id( `owner_id` ) OK
ALTER TABLE cpg1410_pictures ADD `galleryicon` INT UNSIGNED DEFAULT '0' NOT NULL AFTER `approved` Already Done
ALTER TABLE `cpg1410_pictures` ADD `lasthit_ip` TINYTEXT  Already Done
CREATE TABLE `cpg1410_favpics` ( `user_id` INT( 11 ) NOT NULL , `user_favpics` TEXT NOT NULL , PRIMARY KEY ( `user_id` ) ) COMMENT = 'Stores the server side favourites' Already Done
CREATE TABLE cpg1410_dict ( keyId bigint(20) NOT NULL auto_increment, keyword varchar(60) NOT NULL default '', PRIMARY KEY (keyId) ) TYPE=MyISAM COMMENT = 'Holds the keyword dictionary' Already Done
ALTER TABLE `cpg1410_users` CHANGE `user_location` `user_profile1` VARCHAR(255) Already Done
ALTER TABLE `cpg1410_users` CHANGE `user_interests` `user_profile2` VARCHAR(255) Already Done
ALTER TABLE `cpg1410_users` CHANGE `user_website` `user_profile3` VARCHAR(255) Already Done
ALTER TABLE `cpg1410_users` CHANGE `user_occupation` `user_profile4` VARCHAR(255) Already Done
ALTER TABLE `cpg1410_users` ADD `user_profile5` varchar(255) default '' NOT NULL Already Done
ALTER TABLE `cpg1410_users` ADD `user_profile6` varchar(255) default '' NOT NULL Already Done
ALTER TABLE `cpg1410_users` CHANGE `user_password` `user_password` VARCHAR( 40 ) NOT NULL default '' OK
INSERT INTO cpg1410_config VALUES ('user_profile1_name', 'Location') Already Done
INSERT INTO cpg1410_config VALUES ('user_profile2_name', 'Interests') Already Done
INSERT INTO cpg1410_config VALUES ('user_profile3_name', 'Website') Already Done
INSERT INTO cpg1410_config VALUES ('user_profile4_name', 'Occupation') Already Done
INSERT INTO cpg1410_config VALUES ('user_profile5_name', '') Already Done
INSERT INTO cpg1410_config VALUES ('user_profile6_name', 'Biography') Already Done
INSERT INTO cpg1410_config VALUES ('language_fallback', '0') Already Done
INSERT INTO cpg1410_config VALUES ('time_offset', '0') Already Done
ALTER TABLE `cpg1410_users` CHANGE `user_profile6` `user_profile6` TEXT NOT NULL OK
ALTER TABLE `cpg1410_albums` ADD `alb_password` varchar(32) default '' Already Done
INSERT INTO cpg1410_config VALUES ('ban_private_ip', '0') Already Done
INSERT INTO cpg1410_config VALUES ('smtp_host', '') Already Done
INSERT INTO cpg1410_config VALUES ('smtp_username', '') Already Done
INSERT INTO cpg1410_config VALUES ('smtp_password', '') Already Done
INSERT INTO cpg1410_config VALUES ('enable_plugins', '1') Already Done
CREATE TABLE cpg1410_plugins ( plugin_id int(10) unsigned NOT NULL auto_increment, name varchar(64) NOT NULL default '', path varchar(128) NOT NULL default '', priority int(10) unsigned NOT NULL default '0', PRIMARY KEY (plugin_id), UNIQUE KEY name (name), UNIQUE KEY path (path) ) TYPE=MyISAM COMMENT='Stores the plugins' Already Done
INSERT INTO cpg1410_config VALUES ('enable_help', '2') Already Done
INSERT INTO cpg1410_config VALUES ('allow_email_change', '0') Already Done
INSERT INTO cpg1410_config VALUES ('show_which_exif', '|0|0|0|0|0|0|0|0|1|0|1|1|0|0|0|0|0|0|0|0|0|0|0|1|0|0|0|1|0|0|0|1|1|0|0|0|0|1|0|0|0|1|0|0|1|1|0|0|0|0|0|1|0|1|1') Already Done
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: zoti on September 09, 2007, 08:42:34 pm
INSERT INTO cpg1410_config VALUES ('alb_desc_thumb', '1') Already Done
ALTER TABLE `cpg1410_albums` ADD `alb_password_hint` TEXT  Already Done
INSERT INTO cpg1410_config VALUES ('categories_alpha_sort', '0') Already Done
ALTER TABLE `cpg1410_banned` ADD `brute_force` TINYINT( 5 ) DEFAULT '0' NOT NULL  Already Done
INSERT INTO cpg1410_config VALUES ('login_threshold', '5') Already Done
INSERT INTO cpg1410_config VALUES ('login_expiry', '10') Already Done
INSERT INTO cpg1410_config VALUES ('clickable_keyword_search', '1') Already Done
INSERT INTO cpg1410_config VALUES ('link_pic_count', '0') Already Done
ALTER TABLE cpg1410_pictures ADD position INT(11) DEFAULT '0' NOT NULL Already Done
INSERT INTO cpg1410_config VALUES ('auto_resize', '0') Already Done
CREATE TABLE cpg1410_bridge ( name varchar(40) NOT NULL default '0', value varchar(255) NOT NULL default '', UNIQUE KEY name (name) ) TYPE=MyISAM Already Done
INSERT INTO cpg1410_bridge VALUES ('short_name', '') Already Done
INSERT INTO cpg1410_bridge VALUES ('license_number', '') Already Done
INSERT INTO cpg1410_bridge VALUES ('db_database_name', '') Already Done
INSERT INTO cpg1410_bridge VALUES ('db_hostname', '') Already Done
INSERT INTO cpg1410_bridge VALUES ('db_username', '') Already Done
INSERT INTO cpg1410_bridge VALUES ('db_password', '') Already Done
INSERT INTO cpg1410_bridge VALUES ('full_forum_url', '') Already Done
INSERT INTO cpg1410_bridge VALUES ('relative_path_of_forum_from_webroot', '') Already Done
INSERT INTO cpg1410_bridge VALUES ('relative_path_to_config_file', '') Already Done
INSERT INTO cpg1410_bridge VALUES ('logout_flag', '') Already Done
INSERT INTO cpg1410_bridge VALUES ('use_post_based_groups', '') Already Done
INSERT INTO cpg1410_bridge VALUES ('cookie_prefix', '') Already Done
INSERT INTO cpg1410_bridge VALUES ('table_prefix', '') Already Done
INSERT INTO cpg1410_bridge VALUES ('user_table', '') Already Done
INSERT INTO cpg1410_bridge VALUES ('session_table', '') Already Done
INSERT INTO cpg1410_bridge VALUES ('group_table', '') Already Done
INSERT INTO cpg1410_bridge VALUES ('group_relation_table', '') Already Done
INSERT INTO cpg1410_bridge VALUES ('group_mapping_table', '') Already Done
INSERT INTO cpg1410_bridge VALUES ('use_standard_groups', '1') Already Done
INSERT INTO cpg1410_bridge VALUES ('validating_group', '') Already Done
INSERT INTO cpg1410_bridge VALUES ('guest_group', '') Already Done
INSERT INTO cpg1410_bridge VALUES ('member_group', '') Already Done
INSERT INTO cpg1410_bridge VALUES ('admin_group', '') Already Done
INSERT INTO cpg1410_bridge VALUES ('banned_group', '') Already Done
INSERT INTO cpg1410_bridge VALUES ('global_moderators_group', '') Already Done
INSERT INTO cpg1410_bridge VALUES ('recovery_logon_failures', '0') Already Done
INSERT INTO cpg1410_bridge VALUES ('recovery_logon_timestamp', '') Already Done
INSERT INTO cpg1410_config VALUES ('bridge_enable', '0') Already Done
CREATE TABLE cpg1410_vote_stats ( `sid` int(11) NOT NULL auto_increment, `pid` varchar(100) NOT NULL default '', `rating` smallint(6) NOT NULL default '0', `ip` varchar(20) NOT NULL default '', `sdate` bigint(20) NOT NULL default '0', `referer` text NOT NULL, `browser` varchar(255) NOT NULL default '', `os` varchar(50) NOT NULL default '', PRIMARY KEY (`sid`) ) Already Done
INSERT INTO cpg1410_config VALUES ('vote_details', '0') Already Done
CREATE TABLE cpg1410_hit_stats ( `sid` int(11) NOT NULL auto_increment, `pid` varchar(100) NOT NULL default '', `ip` varchar(20) NOT NULL default '', `search_phrase` varchar(255) NOT NULL default '', `sdate` bigint(20) NOT NULL default '0', `referer` text NOT NULL, `browser` varchar(255) NOT NULL default '', `os` varchar(50) NOT NULL default '', PRIMARY KEY (`sid`) ) Already Done
INSERT INTO cpg1410_config VALUES ('hit_details', '0') Already Done
INSERT INTO cpg1410_config VALUES ('browse_batch_add', '1') Already Done
INSERT INTO cpg1410_config VALUES ('custom_header_path', '') Already Done
INSERT INTO cpg1410_config VALUES ('custom_footer_path', '') Already Done
INSERT INTO cpg1410_config VALUES ('comments_sort_descending', '0') Already Done
INSERT INTO cpg1410_config VALUES ('report_post', '0') Already Done
INSERT INTO cpg1410_config VALUES ('users_can_edit_pics', '0') Already Done
INSERT INTO cpg1410_config VALUES ('allow_unlogged_access', '1') Already Done
INSERT INTO cpg1410_config VALUES ('home_target', 'index.php') Already Done
DELETE FROM cpg1410_config WHERE `name` = 'comment_email_notification' OK
DELETE FROM cpg1410_config WHERE `name` = 'hide_admin_uploader' OK
INSERT INTO cpg1410_config VALUES ('custom_lnk_name', '') Already Done
INSERT INTO cpg1410_config VALUES ('custom_lnk_url', '') Already Done
INSERT INTO cpg1410_config VALUES ('comments_anon_pfx', 'Guest_') Already Done
DELETE FROM cpg1410_config WHERE `name` = 'admin_activate' OK
INSERT INTO cpg1410_config VALUES ('admin_activation', '0') Already Done
ALTER TABLE cpg1410_pictures CHANGE `mtime` `mtime` DATETIME OK
DELETE FROM cpg1410_exif OK
DELETE FROM cpg1410_config WHERE `name` = 'randpos_interval' OK
ALTER TABLE cpg1410_pictures DROP INDEX `randpos` Already Done
ALTER TABLE cpg1410_pictures DROP `randpos` Already Done
ALTER TABLE `cpg1410_pictures` CHANGE `mtime` `mtime` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00' OK
ALTER TABLE `cpg1410_albums` CHANGE `description` `description` TEXT NOT NULL OK
INSERT INTO cpg1410_config (name, value) values ('enable_unsharp', '0') Already Done
INSERT INTO cpg1410_config (name, value) values ('unsharp_amount', '120') Already Done
INSERT INTO cpg1410_config (name, value) values ('unsharp_radius', '0.5') Already Done
INSERT INTO cpg1410_config (name, value) values ('unsharp_threshold', '3') Already Done
INSERT INTO cpg1410_config (name, value) values ('thumb_height', '140') Already Done
INSERT INTO cpg1410_config (name, value) values ('enable_watermark', '0') Already Done
INSERT INTO cpg1410_config (name, value) values ('where_put_watermark', 'southeast') Already Done
INSERT INTO cpg1410_config (name, value) values ('watermark_file', 'images/watermark.png') Already Done
INSERT INTO cpg1410_config (name, value) values ('which_files_to_watermark', 'both') Already Done
INSERT INTO cpg1410_config (name, value) values ('orig_pfx', 'orig_') Already Done
INSERT INTO cpg1410_config (name, value) values ('watermark_transparency', '40') Already Done
INSERT INTO cpg1410_config (name, value) values ('reduce_watermark', '0') Already Done
INSERT INTO cpg1410_config (name, value) values ('watermark_transparency_featherx', '0') Already Done
INSERT INTO cpg1410_config (name, value) values ('watermark_transparency_feathery', '0') Already Done
INSERT INTO cpg1410_config (name, value) values ('enable_mini_thumbs', '0') Already Done
INSERT INTO cpg1410_config (name, value) values ('mini_thumb_width', '60') Already Done
INSERT INTO cpg1410_config (name, value) values ('mini_thumb_height', '60') Already Done
INSERT INTO cpg1410_config (name, value) values ('mini_pfx', 'mini_') Already Done
INSERT INTO cpg1410_config (name, value) values ('mini_as_category_lead', '0') Already Done
INSERT INTO cpg1410_config (name, value) values ('enable_user_notification', '0') Already Done
ALTER TABLE cpg1410_users ADD auto_subscribe_post tinyint(4) NOT NULL DEFAULT 1 Already Done
ALTER TABLE cpg1410_users ADD auto_subscribe_comment tinyint(4) NOT NULL DEFAULT 1 Already Done
CREATE TABLE IF NOT EXISTS cpg1410_notify ( user_id INT(10) UNSIGNED NOT NULL DEFAULT 0, picture_id INT(10) UNSIGNED NOT NULL DEFAULT 0, mail_sent TINYINT(4) UNSIGNED NOT NULL DEFAULT 0, PRIMARY KEY (user_id, picture_id) ) TYPE=MyISAM OK
INSERT INTO cpg1410_config (name, value) values ('enable_avatar', '0') Already Done
ALTER TABLE cpg1410_users ADD avatar_url varchar(255) NOT NULL default '' Already Done
CREATE TABLE IF NOT EXISTS cpg1410_pms ( id INT(10) NOT NULL AUTO_INCREMENT, owner int(10) NOT NULL DEFAULT '0', subject VARCHAR(120) NOT NULL DEFAULT '', message TEXT, sender VARCHAR(120) NOT NULL DEFAULT '', sender_id int(10) NOT NULL DEFAULT '0', posted INT(10) NOT NULL DEFAULT '0', sender_ip VARCHAR(120), smileys TINYINT DEFAULT '1', status TINYINT DEFAULT '0', showed TINYINT DEFAULT '0', replied TINYINT DEFAULT '0', PRIMARY KEY (id) ) TYPE=MyISAM OK
ALTER TABLE cpg1410_users ADD user_pmsmail tinyint(4) NOT NULL DEFAULT 1 Already Done
INSERT INTO cpg1410_config (name, value) values ('pms_enabled', '0') Already Done
INSERT INTO cpg1410_config (name, value) values ('pms_messages', '200') Already Done
INSERT INTO cpg1410_config (name, value) values ('pms_enable_email', '1') Already Done
INSERT INTO cpg1410_config (name, value) values ('pms_make_links', '1') Already Done
INSERT INTO cpg1410_config (name, value) values ('pms_date_format', 'l dS of F Y ') Already Done
INSERT INTO cpg1410_config (name, value) values ('pms_time_format', 'h:i:s') Already Done
INSERT INTO cpg1410_config (name, value) values ('pms_smilies', '1') Already Done
INSERT INTO cpg1410_config (name, value) values ('pms_post_flood', '30') Already Done
INSERT INTO cpg1410_config (name, value) values ('pms_message_bbcode', '1') Already Done
INSERT INTO cpg1410_config (name, value) values ('pms_message_img_tag', '1') Already Done
INSERT INTO cpg1410_config (name, value) values ('display_buddy_status', '1') Already Done
INSERT INTO cpg1410_config (name, value) values ('display_pms_status', '1') Already Done
INSERT INTO cpg1410_config (name, value) values ('enable_custom_thumbs', '1') Already Done
INSERT INTO cpg1410_config (name, value) values ('enable_thumb_watermark', '1') Already Done
INSERT INTO cpg1410_config (name, value) values ('enable_buddy', '0') Already Done
INSERT INTO cpg1410_config (name, value) values ('enable_buddy_email', '1') Already Done
INSERT INTO cpg1410_config (name, value) values ('enable_buddy_private_view', '1') Already Done
INSERT INTO cpg1410_config (name, value) values ('buddy_enhanced_display', '1') Already Done
ALTER TABLE cpg1410_users ADD enable_admin_email tinyint(4) NOT NULL DEFAULT 1 Already Done
CREATE TABLE IF NOT EXISTS `cpg1410_buddy_req` ( `id` int(11) NOT NULL auto_increment, `buddy_from` int(11) NOT NULL default '0', `buddy_to` int(11) NOT NULL default '0', `since` int(11) NOT NULL default '0', PRIMARY KEY (`id`) ) TYPE=MyISAM OK
CREATE TABLE IF NOT EXISTS `cpg1410_buddy` ( `id` int(11) NOT NULL auto_increment, `user_id` int(11) NOT NULL default '0', `buddy_id` int(11) NOT NULL default '0', `buddy_ok` enum('YES','NO') NOT NULL default 'NO', `buddy_block` enum('YES','NO') NOT NULL default 'NO', `since` int(11) NOT NULL default '0', PRIMARY KEY (`id`,`user_id`) ) TYPE=MyISAM OK
INSERT INTO cpg1410_config (name, value) values ('fast_stats', '0') Already Done
INSERT INTO cpg1410_config (name, value) values ('enable_stats', '1') Already Done
INSERT INTO cpg1410_config (name, value) values ('enable_loginform', '0') Already Done
INSERT INTO cpg1410_config (name, value) values ('info_block_align', '0') Already Done
INSERT INTO cpg1410_config (name, value) values ('display_pic_voting', '0') Already Done
INSERT INTO cpg1410_config (name, value) values ('display_pic_rating', '0') Already Done
INSERT INTO cpg1410_config (name, value) values ('lang_autodetect', '1') Already Done
INSERT INTO cpg1410_bridge (name, value) values ('avatar_path', '') Already Done

Upgrade completed
It's recommended to check your file versions if you just upgraded from an older version of coppermine.
If you didn't (or you don't want to check), you can go to your gallery's start page

-----------------------

To make it work again I upload the security update and run update.php again but then I obviously don't have your watermark mod.

Thanks,
zoti
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Stramm on September 09, 2007, 08:48:35 pm
If you've questions related to the modpack, then ask on the modpack support forum... even better search before posting cause your 'problem' has been asked and answered before
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: zoti on September 09, 2007, 09:22:47 pm
I did search but maybe I'm not using the right search terms. Can you point me in the direction of the answer to this problem?
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Stramm on September 09, 2007, 09:29:39 pm
the sticky thread in the modpack board
How/What to change to a theme to be 100% operational? (http://forum.coppermine-gallery.net/index.php?topic=34905.msg163858#msg163858)
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: zoti on September 10, 2007, 06:03:16 am
Are you sure we are talking about the same problem?
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Stramm on September 10, 2007, 07:34:43 am
yes, ask on the modpack board...
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: dke on September 22, 2007, 06:29:48 pm
Quote
Setup:
just apply the following code, replace include/picmgmnt.inc.php with the attached file and run update.php

now have a look at your coppermine config. You'll need to modify the path to the watermark. Preset is a file watermark.png in the coppermine images folder. If that doesn't work for you, use the absolute path to the watermark image

uhm, that's what i did and i see exactly nothing new in the config.

however in your next post you post alot of changes, so im very confused, and i suppose to do all the other changes also?
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Stramm on September 22, 2007, 07:05:09 pm
you edited the english (US) lange file... then you need to switch to english US to see the config entries

and yes, you need to do all the edits.. are apply the modpack (pre edited files)
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: Phill Luckhurst on October 14, 2007, 10:14:28 pm
Hi.

I've just tried applying this mod (installed using your superb modpack) and no watermark shows up.

I've run update.php, enabled watermarking for both and uploaded an image to images/watermark.php

I've not run admin tools but just uploaded a new file (http://www.windsurf.me.uk/cpg133/albums/userpics/10002/normal_IMG_5862.jpg) and now watermark appears.

If I can get this working I think thiss would be a superb mod, it is a shame a user cannot have the option to add the watermark to his pictures during uploading with the default no as that would really fit with my siet well.
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Stramm on October 14, 2007, 11:12:42 pm
please post on the modpack board if you have questions related to the modpack. This thread deals with just the watermark mod.

Your watermark.png is corrupted... reupload a working watermark image in png format
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: Phill Luckhurst on October 14, 2007, 11:17:14 pm
Thank you.

Apologies for posting in the wrong thread.
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: bibendum on November 13, 2007, 11:09:59 pm
Hi
Can i apply this wonderfull mod to cpg 1.4.14 ?
Thanks
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Gigatek on November 14, 2007, 04:49:29 am
Anyone with this error in upload.php... I know it comes from picmgmt but I installed and followed the instructions twice with no sucess... thanks..


Code: [Select]
= str_replace('%', '%%', escapeshellarg($dest_file)); } $output = array(); /* * Hack for working with ImageMagick on WIndows even if IM is installed in C:\Program Files. * By Aditya Mooley */ if ($sharpen==1 && $CONFIG['enable_unsharp']==1) { $unsharp_mask = " -unsharp ".$CONFIG['unsharp_radius']."x".sqrt($CONFIG['unsharp_radius'])."+".($CONFIG['unsharp_amount']/100)."+".($CONFIG['unsharp_threshold']/100)." "; } else $unsharp_mask = ""; if (eregi("win",$_ENV['OS'])) { $cmd = "\"".str_replace("\\","/", $CONFIG['impath'])."convert\" -quality {$CONFIG['jpeg_qual']} {$CONFIG['im_options']} ".$resize_commands." ".$unsharp_mask." ".str_replace("\\","/" ,$src_file )." ".str_replace("\\","/" ,$im_dest_file ); exec ("\"$cmd\"", $output, $retval); } else { $cmd = "{$CONFIG['impath']}convert -quality {$CONFIG['jpeg_qual']} {$CONFIG['im_options']} ".$resize_commands." ".$unsharp_mask." $src_file $im_dest_file"; exec ($cmd, $output, $retval); } if ($media_type != "false"){ //if a manual thumb gets generated we watermark the thumb with the media type //we now need to get the absolute path to the thumb watermark files $path_parts = pathinfo($CONFIG['watermark_file']); $CONFIG['watermark_file'] = $path_parts["dirname"]."/wm_".$media_type.".png"; } if ($watermark == "true" || $media_type != "false"){ if (eregi("win",$_ENV['OS'])) { $cmd = "\"".str_replace("\\","/", $CONFIG['impath'])."composite\" -dissolve {$CONFIG['watermark_transparency']} -gravity {$CONFIG['where_put_watermark']} \"{$CONFIG['watermark_file']}\" ".str_replace("\\","/" ,$im_dest_file )." ".str_replace("\\","/" ,$im_dest_file ); exec ("\"$cmd\"", $output, $retval); } else { $cmd = "{$CONFIG['impath']}composite -dissolve {$CONFIG['watermark_transparency']} -gravity {$CONFIG['where_put_watermark']} {$CONFIG['watermark_file']} $im_dest_file $im_dest_file"; exec ($cmd, $output, $retval); } } if ($retval) { $ERROR = "Error executing ImageMagick - Return value: $retval"; if ($CONFIG['debug_mode']) { // Re-execute the command with the backtick operator in order to get all outputs // will not work is safe mode is enabled $output = `$cmd 2>&1`; $ERROR .= "


Cmd line :
" . nl2br(htmlspecialchars($cmd)) . "
"; $ERROR .= "


The convert program said:
"; $ERROR .= nl2br(htmlspecialchars($output)); $ERROR .= "
"; } @unlink($dest_file); return false; } break; case "gd1" : if (!function_exists('imagecreatefromjpeg')) { cpg_die(CRITICAL_ERROR, 'PHP running on your server does not support the GD image library, check with your webhost if ImageMagick is installed', __FILE__, __LINE__); } if ($imginfo[2] == GIS_JPG) $src_img = imagecreatefromjpeg($src_file); else $src_img = imagecreatefrompng($src_file); if (!$src_img) { $ERROR = $lang_errors['invalid_image']; return false; } $dst_img = imagecreate($destWidth, $destHeight); imagecopyresized($dst_img, $src_img, 0, 0, $xOffset, $yOffset, (int)$destWidth, (int)$destHeight, $srcWidth, $srcHeight); imagejpeg($dst_img, $dest_file, $CONFIG['jpeg_qual']); imagedestroy($src_img); imagedestroy($dst_img); break; case "gd2" : if (!function_exists('imagecreatefromjpeg')) { cpg_die(CRITICAL_ERROR, 'PHP running on your server does not support the GD image library, check with your webhost if ImageMagick is installed', __FILE__, __LINE__); } if (!function_exists('imagecreatetruecolor')) { cpg_die(CRITICAL_ERROR, 'PHP running on your server does not support GD version 2.x, please switch to GD version 1.x on the admin page', __FILE__, __LINE__); } if ($imginfo[2] == GIS_GIF && $CONFIG['GIF_support'] == 1) $src_img = imagecreatefromgif($src_file); elseif ($imginfo[2] == GIS_JPG) $src_img = imagecreatefromjpeg($src_file); else $src_img = imagecreatefrompng($src_file); if (!$src_img) { $ERROR = $lang_errors['invalid_image']; return false; } if ($imginfo[2] == GIS_GIF) $dst_img = imagecreate($destWidth, $destHeight); else $dst_img = imagecreatetruecolor($destWidth, $destHeight); imagecopyresampled($dst_img, $src_img, 0, 0, $xOffset, $yOffset, (int)$destWidth, (int)$destHeight, $srcWidth, $srcHeight); if ($sharpen==1 && $CONFIG['enable_unsharp']==1) { UnsharpMask($dst_img, $CONFIG['unsharp_amount'], $CONFIG['unsharp_radius'], $CONFIG['unsharp_threshold']); } if ($media_type != "false"){ //if a manual thumb gets generated we watermark the thumb with the media type //we now need to get the absolute path to the thumb watermark files $path_parts = pathinfo($CONFIG['watermark_file']); $CONFIG['watermark_file'] = $path_parts["dirname"]."/wm_".$media_type.".png"; } if ($watermark == "true" || $media_type != "false"){ $logoImage = ImageCreateFromPNG($CONFIG['watermark_file']); $logoW = ImageSX($logoImage); $logoH = ImageSY($logoImage); //where is the watermark displayed... $pos = $CONFIG['where_put_watermark']; if ($pos == "northwest") { $src_x = 5; $src_y = 5; } else if ($pos == "northeast") { $src_x = $destWidth - ($logoW + 5); $src_y = 5; } else if ($pos == "southwest") { $src_x = 5; $src_y = $destHeight - ($logoH + 5); } else if ($pos == "southeast") { $src_x = $destWidth - ($logoW + 5); $src_y = $destHeight - ($logoH + 5); } else if ($pos == "center") { $src_x = ($destWidth/2) - ($logoW/2); $src_y = ($destHeight/2) - ($logoH/2); } imagealphablending($dst_img, TRUE); imagecolortransparent($logoImage, imagecolorat($logoImage, $CONFIG['watermark_transparency_featherx'], $CONFIG['watermark_transparency_feathery'])); //ImageCopyMerge($dst_img,$logoImage,$src_x,$src_y,0,0,$logoW,$logoH,$CONFIG['watermark_transparency']); //$dst_x,$dst_y,0,0,$logoW,$logoH); ImageCopy($dst_img,$logoImage,$src_x,$src_y,0,0,$logoW,$logoH); //$dst_x,$dst_y,0,0,$logoW,$logoH); } imagejpeg($dst_img, $dest_file, $CONFIG['jpeg_qual']); imagedestroy($src_img); imagedestroy($dst_img); break; } // Set mode of uploaded picture @chmod($dest_file, octdec($CONFIG['default_file_mode'])); //silence the output in case chmod is disabled // We check that the image is valid $imginfo = getimagesize($dest_file); if ($imginfo == null) { $ERROR = $lang_errors['resize_failed']; @unlink($dest_file); return false; } else { return true; } } function UnsharpMask($img, $amount, $radius, $threshold)
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Stramm on November 14, 2007, 07:52:48 am
reupload picmgmnt.inc.php. Make sure you overwrite the original... or rename the original file to something else and then upload
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Gigatek on November 14, 2007, 12:42:00 pm
reupload picmgmnt.inc.php. Make sure you overwrite the original... or rename the original file to something else and then upload

Downloaded it again and it worked... thanks
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: bibendum on November 16, 2007, 09:59:06 am
Hi
Can i apply this wonderfull mod to cpg 1.4.14 ?
Thanks


Hi
I will answer myself !!!
It's working on cpg 1.4.14  ;)
Thanks
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Qayyom on November 17, 2007, 07:06:59 am
Hi

Is it Possible?

I want to apply watermark on all previous images.

I've 1000+ pics collection on my site.

If possible then how?
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Stramm on November 17, 2007, 09:40:08 am
don't be so lazy and read the first post of this thread
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Bastox on November 25, 2007, 06:52:45 am
Hi Stramm...

I've just installed your pack. Thank's it's very good. But I think you forget something in admin.php.

In the admin pannel, There is no way to change the prefix "orig_"
Nothing in admin.php, nothing in lang/english.php...

The watermarking is a way to "secure" the pictures. If everyone can acces them because you've got just to put "orig_" before the name of the picture the MOD becaume less usefull.

Cheers.

Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: TurboSc on November 25, 2007, 07:45:15 am
Hey Stramm,

I've read every post ( including the first one :P ) and I'm having some issues with the watermark function.

Please also keep in mind I'm pretty much a newb to all of this but I followed your directions...

I replaced picmgmt.inc.php and ran update.php but once I go into the config menu, there is no sign of watermark options etc.

I tried replacing it with the newer file from your modpack, ran update.php, still no luck.

I replaced lang/english.php from your modpack and ran update with "some" success, the watermark options show, but it seems the bottom of the config menu is broken ( the buttons to save config, etc are missing ) Under watermarking it also says "invalid options"

I'm running Coppermine Photo Gallery 1.4.14 (stable) with no other plugins, I just need watermarking to work basically, hehe... do I need to replace the /lang/english.php or update it?

if so what do I need to add to this file to get watermarking to work. Thank you in advance.

- Sunny
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: TurboSc on November 25, 2007, 08:52:35 am
Hey Stramm,

I've read every post ( including the first one :P ) and I'm having some issues with the watermark function.

Please also keep in mind I'm pretty much a newb to all of this but I followed your directions...

I replaced picmgmt.inc.php and ran update.php but once I go into the config menu, there is no sign of watermark options etc.

I tried replacing it with the newer file from your modpack, ran update.php, still no luck.

I replaced lang/english.php from your modpack and ran update with "some" success, the watermark options show, but it seems the bottom of the config menu is broken ( the buttons to save config, etc are missing ) Under watermarking it also says "invalid options"

I'm running Coppermine Photo Gallery 1.4.14 (stable) with no other plugins, I just need watermarking to work basically, hehe... do I need to replace the /lang/english.php or update it?

if so what do I need to add to this file to get watermarking to work. Thank you in advance.

- Sunny

I'm an idiot, and I've since reread your thread and gotten everything working. Please forgive me :P

I did read however somewhere within those 13 pages of information a way to change the padding of the watermark placement... could you help me locate the place to make that happen?

What I'm trying to do actually is to get rid of it, because my watermark needs to sit flush top right with no pixel padding at all... Thanks in advance.
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Stramm on November 25, 2007, 10:21:05 am
Hi Stramm...

I've just installed your pack. Thank's it's very good. But I think you forget something in admin.php.

In the admin pannel, There is no way to change the prefix "orig_"
Nothing in admin.php, nothing in lang/english.php...

The watermarking is a way to "secure" the pictures. If everyone can acces them because you've got just to put "orig_" before the name of the picture the MOD becaume less usefull.

Cheers.



It's not meant to be changed (yet) cause it's not tested if it'll work. If you dare to try, you can edit that in the db (table config). Also there's a description (somewhere, I do not remember, either in a modpack or one of the watermark mod threads [1.3 or 1.4]) how to edit the code to prevent the script from generating the orig backup.
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Stramm on November 25, 2007, 10:29:42 am
I'm an idiot, and I've since reread your thread and gotten everything working. Please forgive me :P

I did read however somewhere within those 13 pages of information a way to change the padding of the watermark placement... could you help me locate the place to make that happen?

What I'm trying to do actually is to get rid of it, because my watermark needs to sit flush top right with no pixel padding at all... Thanks in advance.

You have to do some code changes in picmgmnt.inc.php. Please make sure you have an up to date one (download the modpack and get it there). Then find
Code: [Select]
    $pos = $CONFIG['where_put_watermark'];and below replace all occurances of '5' (that's the actual padding in px) with the padding you desire ('0' in your case)
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: bones on November 29, 2007, 06:00:51 pm
I've applied this mod and no problems whatsoever.

A big THANKS to everyone responsible for this mod!

(https://forum.coppermine-gallery.net/proxy.php?request=http%3A%2F%2Fbikers-n-outlaws.com%2Fgallery-stats.gif&hash=18e9e623f773eca2e76cce4ece7aef2c) (http://www.bikers-n-outlaws.com/cpg/)
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Bastox on November 30, 2007, 08:00:02 am
It's not meant to be changed (yet) cause it's not tested if it'll work. If you dare to try, you can edit that in the db (table config). Also there's a description (somewhere, I do not remember, either in a modpack or one of the watermark mod threads [1.3 or 1.4]) how to edit the code to prevent the script from generating the orig backup.
Tested... That works work for me. I think you can add a option forthe next version...  ;)
After a double check...

I can test that as well if you want (http://forum.coppermine-gallery.net/index.php?topic=28367.msg135115#msg135115)
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Stramm on November 30, 2007, 09:03:54 am
Tested... That works work for me. I think you can add a option forthe next version...  ;)
After a double check...

I can test that as well if you want (http://forum.coppermine-gallery.net/index.php?topic=28367.msg135115#msg135115)

it's already added to the upcoming  version 1.5
the custom thumb tool you link to is from march 2006, a new, improved version has been released since that (within the modpack)
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Hayvosh on December 19, 2007, 11:33:18 pm
I might have missed something during the installation, I've tried to install this two times but I get this same error anyhow.
What could I be doing wrong?

Code: [Select]
$src_file = escapeshellarg($src_file); $im_dest_file = str_replace('%', '%%', escapeshellarg($dest_file)); } $output = array(); /* * Hack for working with ImageMagick on WIndows even if IM is installed in C:\Program Files. * By Aditya Mooley */ if ($sharpen==1 && $CONFIG['enable_unsharp']==1) { $unsharp_mask = " -unsharp ".$CONFIG['unsharp_radius']."x".sqrt($CONFIG['unsharp_radius'])."+".($CONFIG['unsharp_amount']/100)."+".($CONFIG['unsharp_threshold']/100)." "; } else $unsharp_mask = ""; if (eregi("win",$_ENV['OS'])) { $cmd = "\"".str_replace("\\","/", $CONFIG['impath'])."convert\" -quality {$CONFIG['jpeg_qual']} {$CONFIG['im_options']} ".$resize_commands." ".$unsharp_mask." ".str_replace("\\","/" ,$src_file )." ".str_replace("\\","/" ,$im_dest_file ); exec ("\"$cmd\"", $output, $retval); } else { $cmd = "{$CONFIG['impath']}convert -quality {$CONFIG['jpeg_qual']} {$CONFIG['im_options']} ".$resize_commands." ".$unsharp_mask." $src_file $im_dest_file"; exec ($cmd, $output, $retval); } if ($media_type != "false"){ //if a manual thumb gets generated we watermark the thumb with the media type //we now need to get the absolute path to the thumb watermark files $path_parts = pathinfo($CONFIG['watermark_file']); $CONFIG['watermark_file'] = $path_parts["dirname"]."/wm_".$media_type.".png"; } if ($watermark == "true" || $media_type != "false"){ if (eregi("win",$_ENV['OS'])) { $cmd = "\"".str_replace("\\","/", $CONFIG['impath'])."composite\" -dissolve {$CONFIG['watermark_transparency']} -gravity {$CONFIG['where_put_watermark']} \"{$CONFIG['watermark_file']}\" ".str_replace("\\","/" ,$im_dest_file )." ".str_replace("\\","/" ,$im_dest_file ); exec ("\"$cmd\"", $output, $retval); } else { $cmd = "{$CONFIG['impath']}composite -dissolve {$CONFIG['watermark_transparency']} -gravity {$CONFIG['where_put_watermark']} {$CONFIG['watermark_file']} $im_dest_file $im_dest_file"; exec ($cmd, $output, $retval); } } if ($retval) { $ERROR = "Error executing ImageMagick - Return value: $retval"; if ($CONFIG['debug_mode']) { // Re-execute the command with the backtick operator in order to get all outputs // will not work is safe mode is enabled $output = `$cmd 2>&1`; $ERROR .= "

Cmd line :
" . nl2br(htmlspecialchars($cmd)) . "
"; $ERROR .= "

The convert program said:
"; $ERROR .= nl2br(htmlspecialchars($output)); $ERROR .= "
"; } @unlink($dest_file); return false; } break; case "gd1" : if (!function_exists('imagecreatefromjpeg')) { cpg_die(CRITICAL_ERROR, 'PHP running on your server does not support the GD image library, check with your webhost if ImageMagick is installed', __FILE__, __LINE__); } if ($imginfo[2] == GIS_JPG) $src_img = imagecreatefromjpeg($src_file); else $src_img = imagecreatefrompng($src_file); if (!$src_img) { $ERROR = $lang_errors['invalid_image']; return false; } $dst_img = imagecreate($destWidth, $destHeight); imagecopyresized($dst_img, $src_img, 0, 0, $xOffset, $yOffset, (int)$destWidth, (int)$destHeight, $srcWidth, $srcHeight); imagejpeg($dst_img, $dest_file, $CONFIG['jpeg_qual']); imagedestroy($src_img); imagedestroy($dst_img); break; case "gd2" : if (!function_exists('imagecreatefromjpeg')) { cpg_die(CRITICAL_ERROR, 'PHP running on your server does not support the GD image library, check with your webhost if ImageMagick is installed', __FILE__, __LINE__); } if (!function_exists('imagecreatetruecolor')) { cpg_die(CRITICAL_ERROR, 'PHP running on your server does not support GD version 2.x, please switch to GD version 1.x on the admin page', __FILE__, __LINE__); } if ($imginfo[2] == GIS_GIF && $CONFIG['GIF_support'] == 1) $src_img = imagecreatefromgif($src_file); elseif ($imginfo[2] == GIS_JPG) $src_img = imagecreatefromjpeg($src_file); else $src_img = imagecreatefrompng($src_file); if (!$src_img) { $ERROR = $lang_errors['invalid_image']; return false; } if ($imginfo[2] == GIS_GIF) $dst_img = imagecreate($destWidth, $destHeight); else $dst_img = imagecreatetruecolor($destWidth, $destHeight); imagecopyresampled($dst_img, $src_img, 0, 0, $xOffset, $yOffset, (int)$destWidth, (int)$destHeight, $srcWidth, $srcHeight); if ($sharpen==1 && $CONFIG['enable_unsharp']==1) { UnsharpMask($dst_img, $CONFIG['unsharp_amount'], $CONFIG['unsharp_radius'], $CONFIG['unsharp_threshold']); } if ($media_type != "false"){ //if a manual thumb gets generated we watermark the thumb with the media type //we now need to get the absolute path to the thumb watermark files $path_parts = pathinfo($CONFIG['watermark_file']); $CONFIG['watermark_file'] = $path_parts["dirname"]."/wm_".$media_type.".png"; } if ($watermark == "true" || $media_type != "false"){ $logoImage = ImageCreateFromPNG($CONFIG['watermark_file']); $logoW = ImageSX($logoImage); $logoH = ImageSY($logoImage); //where is the watermark displayed... $pos = $CONFIG['where_put_watermark']; if ($pos == "northwest") { $src_x = 5; $src_y = 5; } else if ($pos == "northeast") { $src_x = $destWidth - ($logoW + 5); $src_y = 5; } else if ($pos == "southwest") { $src_x = 5; $src_y = $destHeight - ($logoH + 5); } else if ($pos == "southeast") { $src_x = $destWidth - ($logoW + 5); $src_y = $destHeight - ($logoH + 5); } else if ($pos == "center") { $src_x = ($destWidth/2) - ($logoW/2); $src_y = ($destHeight/2) - ($logoH/2); } imagealphablending($dst_img, TRUE); imagecolortransparent($logoImage, imagecolorat($logoImage, $CONFIG['watermark_transparency_featherx'], $CONFIG['watermark_transparency_feathery'])); //ImageCopyMerge($dst_img,$logoImage,$src_x,$src_y,0,0,$logoW,$logoH,$CONFIG['watermark_transparency']); //$dst_x,$dst_y,0,0,$logoW,$logoH); ImageCopy($dst_img,$logoImage,$src_x,$src_y,0,0,$logoW,$logoH); //$dst_x,$dst_y,0,0,$logoW,$logoH); } imagejpeg($dst_img, $dest_file, $CONFIG['jpeg_qual']); imagedestroy($src_img); imagedestroy($dst_img); break; } // Set mode of uploaded picture @chmod($dest_file, octdec($CONFIG['default_file_mode'])); //silence the output in case chmod is disabled // We check that the image is valid $imginfo = getimagesize($dest_file); if ($imginfo == null) { $ERROR = $lang_errors['resize_failed']; @unlink($dest_file); return false; } else { return true; } } function UnsharpMask($img, $amount, $radius, $threshold) { //////////////////////////////////////////////////////////////////////////////////////////////// //// //// p h p U n s h a r p M a s k //// //// Unsharp mask algorithm by Torstein H�nsi 2003. //// thoensi_at_netcom_dot_no. //// Please leave this notice. //// /////////////////////////////////////////////////////////////////////////////////////////////// if ($amount > 500) $amount = 500; $amount = $amount * 0.016; if ($radius > 50) $radius = 50; $radius = $radius * 2; if ($threshold > 255) $threshold = 255; $radius = abs(round($radius)); // Only integers make sense. if ($radius == 0) { return $img; imagedestroy($img); break; } $w = imagesx($img); $h = imagesy($img); $imgCanvas = imagecreatetruecolor($w, $h); $imgCanvas2 = imagecreatetruecolor($w, $h); $imgBlur = imagecreatetruecolor($w, $h); $imgBlur2 = imagecreatetruecolor($w, $h); imagecopy ($imgCanvas, $img, 0, 0, 0, 0, $w, $h); imagecopy ($imgCanvas2, $img, 0, 0, 0, 0, $w, $h); for ($i = 0; $i < $radius; $i++) { imagecopy ($imgBlur, $imgCanvas, 0, 0, 1, 1, $w - 1, $h - 1); // up left imagecopymerge ($imgBlur, $imgCanvas, 1, 1, 0, 0, $w, $h, 50); // down right imagecopymerge ($imgBlur, $imgCanvas, 0, 1, 1, 0, $w - 1, $h, 33.33333); // down left imagecopymerge ($imgBlur, $imgCanvas, 1, 0, 0, 1, $w, $h - 1, 25); // up right imagecopymerge ($imgBlur, $imgCanvas, 0, 0, 1, 0, $w - 1, $h, 33.33333); // left imagecopymerge ($imgBlur, $imgCanvas, 1, 0, 0, 0, $w, $h, 25); // right imagecopymerge ($imgBlur, $imgCanvas, 0, 0, 0, 1, $w, $h - 1, 20 ); // up imagecopymerge ($imgBlur, $imgCanvas, 0, 1, 0, 0, $w, $h, 16.666667); // down imagecopymerge ($imgBlur, $imgCanvas, 0, 0, 0, 0, $w, $h, 50); //center imagecopy ($imgCanvas, $imgBlur, 0, 0, 0, 0, $w, $h); imagecopy ($imgBlur2, $imgCanvas2, 0, 0, 0, 0, $w, $h); imagecopymerge ($imgBlur2, $imgCanvas2, 0, 0, 0, 0, $w, $h, 50); imagecopymerge ($imgBlur2, $imgCanvas2, 0, 0, 0, 0, $w, $h, 33.33333); imagecopymerge ($imgBlur2, $imgCanvas2, 0, 0, 0, 0, $w, $h, 25); imagecopymerge ($imgBlur2, $imgCanvas2, 0, 0, 0, 0, $w, $h, 33.33333); imagecopymerge ($imgBlur2, $imgCanvas2, 0, 0, 0, 0, $w, $h, 25); imagecopymerge ($imgBlur2, $imgCanvas2, 0, 0, 0, 0, $w, $h, 20 ); imagecopymerge ($imgBlur2, $imgCanvas2, 0, 0, 0, 0, $w, $h, 16.666667); imagecopymerge ($imgBlur2, $imgCanvas2, 0, 0, 0, 0, $w, $h, 50); imagecopy ($imgCanvas2, $imgBlur2, 0, 0, 0, 0, $w, $h); } for ($x = 0; $x < $w; $x++) { // each row for ($y = 0; $y < $h; $y++) { // each pixel $rgbOrig = ImageColorAt($imgCanvas2, $x, $y); $rOrig = (($rgbOrig >> 16) & 0xFF); $gOrig = (($rgbOrig >> 8) & 0xFF); $bOrig = ($rgbOrig & 0xFF); $rgbBlur = ImageColorAt($imgCanvas, $x, $y); $rBlur = (($rgbBlur >> 16) & 0xFF); $gBlur = (($rgbBlur >> 8) & 0xFF); $bBlur = ($rgbBlur & 0xFF); $rNew = (abs($rOrig - $rBlur) >= $threshold) ? max(0, min(255, ($amount * ($rOrig - $rBlur)) + $rOrig)) : $rOrig; $gNew = (abs($gOrig - $gBlur) >= $threshold) ? max(0, min(255, ($amount * ($gOrig - $gBlur)) + $gOrig)) : $gOrig; $bNew = (abs($bOrig - $bBlur) >= $threshold) ? max(0, min(255, ($amount * ($bOrig - $bBlur)) + $bOrig)) : $bOrig; if (($rOrig != $rNew) || ($gOrig != $gNew) || ($bOrig != $bNew)) { $pixCol = ImageColorAllocate($img, $rNew, $gNew, $bNew); ImageSetPixel($img, $x, $y, $pixCol); } } } imagedestroy($imgCanvas); imagedestroy($imgCanvas2); imagedestroy($imgBlur); imagedestroy($imgBlur2); return $img; } ?>, 0, 1, 1, $w - 1, $h - 1); // up left imagecopymerge ($imgBlur, $imgCanvas, 1, 1, 0, 0, $w, $h, 50); // down right imagecopymerge ($imgBlur, $imgCanvas, 0, 1, 1, 0, $w - 1, $h, 33.33333); // down left imagecopymerge ($imgBlur, $imgCanvas, 1, 0, 0, 1, $w, $h - 1, 25); // up right imagecopymerge ($imgBlur, $imgCanvas, 0, 0, 1, 0, $w - 1, $h, 33.33333); // left imagecopymerge ($imgBlur, $imgCanvas, 1, 0, 0, 0, $w, $h, 25); // right imagecopymerge ($imgBlur, $imgCanvas, 0, 0, 0, 1, $w, $h - 1, 20 ); // up imagecopymerge ($imgBlur, $imgCanvas, 0, 1, 0, 0, $w, $h, 16.666667); // down imagecopymerge ($imgBlur, $imgCanvas, 0, 0, 0, 0, $w, $h, 50); // center imagecopy ($imgCanvas, $imgBlur, 0, 0, 0, 0, $w, $h); imagecopy ($imgBlur2, $imgCanvas2, 0, 0, 0, 0, $w, $h); imagecopymerge ($imgBlur2, $imgCanvas2, 0, 0, 0, 0, $w, $h, 50); imagecopymerge ($imgBlur2, $imgCanvas2, 0, 0, 0, 0, $w, $h, 33.33333); imagecopymerge ($imgBlur2, $imgCanvas2, 0, 0, 0, 0, $w, $h, 25); imagecopymerge ($imgBlur2, $imgCanvas2, 0, 0, 0, 0, $w, $h, 33.33333); imagecopymerge ($imgBlur2, $imgCanvas2, 0, 0, 0, 0, $w, $h, 25); imagecopymerge ($imgBlur2, $imgCanvas2, 0, 0, 0, 0, $w, $h, 20 ); imagecopymerge ($imgBlur2, $imgCanvas2, 0, 0, 0, 0, $w, $h, 16.666667); imagecopymerge ($imgBlur2, $imgCanvas2, 0, 0, 0, 0, $w, $h, 50); imagecopy ($imgCanvas2, $imgBlur2, 0, 0, 0, 0, $w, $h); } for ($x = 0; $x < $w; $x++) { // each row for ($y = 0; $y < $h; $y++) { // each pixel $rgbOrig = ImageColorAt($imgCanvas2, $x, $y); $rOrig = (($rgbOrig >> 16) & 0xFF); $gOrig = (($rgbOrig >> 8) & 0xFF); $bOrig = ($rgbOrig & 0xFF); $rgbBlur = ImageColorAt($imgCanvas, $x, $y); $rBlur = (($rgbBlur >> 16) & 0xFF); $gBlur = (($rgbBlur >> 8) & 0xFF); $bBlur = ($rgbBlur & 0xFF); $rNew = (abs($rOrig - $rBlur) >= $threshold) ? max(0, min(255, ($amount * ($rOrig - $rBlur)) + $rOrig)) : $rOrig; $gNew = (abs($gOrig - $gBlur) >= $threshold) ? max(0, min(255, ($amount * ($gOrig - $gBlur)) + $gOrig)) : $gOrig; $bNew = (abs($bOrig - $bBlur) >= $threshold) ? max(0, min(255, ($amount * ($bOrig - $bBlur)) + $bOrig)) : $bOrig; if (($rOrig != $rNew) || ($gOrig != $gNew) || ($bOrig != $bNew)) { $pixCol = ImageColorAllocate($img, $rNew, $gNew, $bNew); ImageSetPixel($img, $x, $y, $pixCol); } } } imagedestroy($imgCanvas); imagedestroy($imgCanvas2); imagedestroy($imgBlur); imagedestroy($imgBlur2); return $img; } ?> * ($rOrig - $rBlur)) + $rOrig)) : $rOrig; $gNew = (abs($gOrig - $gBlur) >= $threshold) ? max(0, min(255, ($amount * ($gOrig - $gBlur)) + $gOrig)) : $gOrig; $bNew = (abs($bOrig - $bBlur) >= $threshold) ? max(0, min(255, ($amount * ($bOrig - $bBlur)) + $bOrig)) : $bOrig; if (($rOrig != $rNew) || ($gOrig != $gNew) || ($bOrig != $bNew)) { $pixCol = ImageColorAllocate($img, $rNew, $gNew, $bNew); ImageSetPixel($img, $x, $y, $pixCol); } } } } else{ for ($x = 0; $x < $w; $x++) { // each row for ($y = 0; $y < $h; $y++) { // each pixel $rgbOrig = ImageColorAt($img, $x, $y); $rOrig = (($rgbOrig >> 16) & 0xFF); $gOrig = (($rgbOrig >> 8) & 0xFF); $bOrig = ($rgbOrig & 0xFF); $rgbBlur = ImageColorAt($imgBlur, $x, $y); $rBlur = (($rgbBlur >> 16) & 0xFF); $gBlur = (($rgbBlur >> 8) & 0xFF); $bBlur = ($rgbBlur & 0xFF); $rNew = ($amount * ($rOrig - $rBlur)) + $rOrig; if($rNew>255){$rNew=255;} elseif($rNew<0){$rNew=0;} $gNew = ($amount * ($gOrig - $gBlur)) + $gOrig; if($gNew>255){$gNew=255;} elseif($gNew<0){$gNew=0;} $bNew = ($amount * ($bOrig - $bBlur)) + $bOrig; if($bNew>255){$bNew=255;} elseif($bNew<0){$bNew=0;} $rgbNew = ($rNew << 16) + ($gNew <<8) + $bNew; ImageSetPixel($img, $x, $y, $rgbNew); } } } imagedestroy($imgCanvas); imagedestroy($imgBlur); return $img; } //used for custom thumbs function crop_image($src_file, $dest_file, $new_size_w, $new_size_h, $xOffset, $yOffset) { global $CONFIG, $ERROR; global $lang_errors; $imginfo = getimagesize($src_file); if ($imginfo == null) return false; // GD can only handle JPG & PNG images if ($imginfo[2] != GIS_JPG && $imageinfo[2] != GIS_PNG && $CONFIG['GIF_support'] == 0) { $ERROR = $lang_errors['gd_file_type_err']; return false; } switch ($CONFIG['thumb_method']) { case "im" : if (preg_match("#[A-Z]:|\\\\#Ai", __FILE__)) { // get the basedir, remove '/include' $cur_dir = substr(dirname(__FILE__), 0, -8); $src_file = '"' . $cur_dir . '\\' . strtr($src_file, '/', '\\') . '"'; $im_dest_file = str_replace('%', '%%', ('"' . $cur_dir . '\\' . strtr($dest_file, '/', '\\') . '"')); } else { $src_file = escapeshellarg($src_file); $im_dest_file = str_replace('%', '%%', escapeshellarg($dest_file)); } $output = array(); /* * Hack for working with ImageMagick on WIndows even if IM is installed in C:\Program Files. * By Aditya Mooley */ $resize_commands = $new_size_w . "x" . $new_size_h . "+" . $xOffset . "+" . $yOffset; if (eregi("win",$_ENV['OS'])) { $cmd = "\"".str_replace("\\","/", $CONFIG['impath'])."convert\" -quality 100 -crop ".$resize_commands." ".str_replace("\\","/" ,$src_file )." ".str_replace("\\","/" ,$im_dest_file ); exec ("\"$cmd\"", $output, $retval); } else { $cmd = "{$CONFIG['impath']}convert -quality 100 -crop ".$resize_commands." $src_file $im_dest_file"; exec ($cmd, $output, $retval); } if ($retval) { $ERROR = "Error executing ImageMagick - Return value: $retval"; if ($CONFIG['debug_mode']) { // Re-execute the command with the backtick operator in order to get all outputs // will not work is safe mode is enabled $output = `$cmd 2>&1`; $ERROR .= "

Cmd line :
" . nl2br(htmlspecialchars($cmd)) . "
"; $ERROR .= "

The convert program said:
"; $ERROR .= nl2br(htmlspecialchars($output)); $ERROR .= "
"; } @unlink($dest_file); return false; } else { return true; } break; case "gd2" : if ($imginfo[2] == GIS_GIF && $CONFIG['GIF_support'] == 1) $src_img = imagecreatefromgif($src_file); elseif ($imginfo[2] == GIS_JPG) $src_img = imagecreatefromjpeg($src_file); else $src_img = imagecreatefrompng($src_file); if (!$src_img) { $ERROR = $lang_errors['invalid_image']; return false; } if ($imginfo[2] == GIS_GIF) $dst_img = imagecreate($new_size_w, $new_size_h); else $dst_img = imagecreatetruecolor($new_size_w, $new_size_h); imagecopyresampled($dst_img, $src_img, 0, 0, $xOffset, $yOffset, $new_size_w+$xOffset, $new_size_h+$yOffset, $new_size_w+$xOffset, $new_size_h+$yOffset); imagejpeg($dst_img, $dest_file, 100); imagedestroy($src_img); imagedestroy($dst_img); // Set mode of uploaded picture @chmod($dest_file, octdec($CONFIG['default_file_mode'])); //silence the output in case chmod is disabled // We check that the image is valid $imginfo = getimagesize($dest_file); if ($imginfo == null) { $ERROR = $lang_errors['resize_failed']; @unlink($dest_file); return false; } else { return true; } break; }// end switch } ?>
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Stramm on December 19, 2007, 11:41:00 pm
reupload picmgmnt.inc.php
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Hayvosh on December 20, 2007, 12:46:41 am
reupload picmgmnt.inc.php

Can I use the one 1.4.6 version or? Because that was the one I tried with earlier when it didnt work.
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Stramm on December 20, 2007, 07:38:38 am
should work... but better use the up to date one from the modpack
http://forum.coppermine-gallery.net/index.php?topic=28367.0
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: thegap on January 02, 2008, 08:05:15 am
Hello,
Everything work fine with this MOD by Stream,but water mark show only on  the resise image not both (Resise +Original picture), i don't know and understand why  :o ? May someone can help , thank ,i'm using CPG ver 1.12
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Stramm on January 02, 2008, 08:37:25 am
When batch adding the watermarking process needs extra permissions. That's ause the image you uploaded to the server gets modified and saved again. If permissions don't match, then the server doesn't allow the saving. So chmod the images you want to batch add to 644 or 666 (depending on server setup) and the folders they are in to 777 or 755. 

Upgrade to 1.4.14 asap
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: rosner on January 04, 2008, 04:44:32 pm
Stramm,

Sorry for bother you.

I've no problem to install watermark,but while i enter to "admin config" of  "Image Watermarking",I cannot choose "Watermark Image" :(yes or no),I choose "yes",after continue,it is still "no"....

What is the problem?

the php script is correct no error,please help.

My version is CPG ver 1.4.14

link:www.milenarosner.com/gallery
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Stramm on January 04, 2008, 05:13:37 pm
from the first post
Quote
Setup:
just apply the following code, replace include/picmgmnt.inc.php with the attached file and run update.php
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: rosner on January 04, 2008, 05:21:04 pm
from the first post

sorry,i'm a newb
what you mean by run update.php?
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: rosner on January 04, 2008, 05:50:42 pm
Stramm,

I fixed the problem finally,thank for the great hack for watermarking.

That's a very good hack to stop do stupid watermark form some photo software.

A useful watermark anyway!

I love u stramm! ;D
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: slYbYte on January 05, 2008, 11:45:53 pm
rosner, just run http://youdomain/gallery/update.php
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: rosner on January 06, 2008, 11:53:38 am
rosner, just run http://youdomain/gallery/update.php

Thank you!
I done it!!!
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: vladale on January 12, 2008, 02:19:16 am
I installed this without any problems, but found some bug in it, well, if it's a bug.

Watermarking works perfectly with Upload File (upload.php) but doesn't work fully with batch uploading. Actually, it works, but it watermarks only pictures which are resized. When you open original one, watermark is not shown, not sure why? Thanks!
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Stramm on January 12, 2008, 07:59:39 am
Has been asked and answered at least 10 times before. Last time just a few posts above
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: vladale on January 12, 2008, 11:58:50 am
Yeah, I know and I finally managed to see where the problem was. The problem was in image permissions, I had to chmod them all to 777 in order to watermark properly. Thanks!
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: pcp20us on January 14, 2008, 10:25:25 am
Hi all

Hope this is the right place for this

I applied this mod about a yaer ago. I remeber it took a lot of configuring. I have a local test server, which i upgraded to the latest version, hence lost the great watermark. is there a way to stop this from happening. ie: back up these files then copy theme back over the upgrade or will that cause drama, is there a list of what files you mod for this watermark hack, so i know what to backup.

Any suggestion appreciated.

Happy New Year
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Stramm on January 14, 2008, 10:37:37 am
The list what you modify is in the instructions... backing up the modded files and overwriting the upgraded ones isn't recommended at all cause you undo the upgrade with that.

This is a mod. Means you'll have to mod each upgrade yourself. If you'd use the modpack, you can apply premodded files. 
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: pcp20us on January 14, 2008, 10:56:15 am
Hi Stramm.

Thanks for that. I read the instructions, mmm i should r thought of that !

I am a bit confused re mod packs and strammpacks
I have a stramm 1.4x plugin pack v3 and a stramm mod1 1_4_13_bridge.

Now i understand that the mod pack is for when you are bridging ?? i am not i have stand alone coppermine.

Under plugin pack i had great problems with cpgmark (and see not much has happened with it)

This hack seems to be the only one i could get to work, this is about 2 years ago. Are there an watermark tools like tis stramm one which is a plugin as apoosed to a hack

You say"If you'd use the modpack, you can apply premodded files.  "
Do i have the right mod pack?? cause theres nothing in there re watermarking.

Cheers

Pete
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Stramm on January 14, 2008, 11:24:48 am
There's a plugin pack, but no stramm plugin pack... it contains some of my plugins afaik. However I haven't written a watermark plugin as I have not seen a practical way to implement the functions I wanted using th plugin api.

The modack is a bundle of files that contain my mods. It's premodded filed so users get rid of applying the changes to each upgrade themselves. As I don't use a bridge myself, the modpack was intended for an unbridged coppermine. Later I've added bridge support (for some forums, not all supported by the original coppermine).

Features of the modpack you can see in its announcement thread http://forum.coppermine-gallery.net/index.php?topic=28367.0 :
Watermarking, thumb cropping, custom thumb tool (my new favourite: http://forum.coppermine-gallery.net/index.php?topic=47538.0), avatars, pm, comment notification, buddies etc.
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: pcp20us on January 21, 2008, 10:20:15 am
Stramm

Thanks mate for clearing that up. I shall apply the upgrade when i get a chance.

Cheers

Pete
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: torontokills on January 26, 2008, 09:37:38 am
Just applied my first mod, and it worked, cant believe it.  Thanks for this Mod Stramm.  It works..
but i do have one small issue, or something i noticed.

I believe the Watermark will only work on pictures that are at least the intermediate size value that is set in config

Many photos I have on coppermine are unresized even though 'create intermediate pictures' is selected, (cause I'm guessing Coppermine doesnt bother to resize originals that are smaller than intermediate value) ..and these originals that never got intermediate files created in the first place did not get affected by the mod.

So bottom line is if u have originals that are smaller than your intermediates they will not be affected by the mod, even when selecting 'both' in watermark config?
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Stramm on January 26, 2008, 12:18:40 pm
should work without problems...
post a link and a login with upload permissions. Also tell me your settings so I can test it.
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: tinorebel on February 01, 2008, 06:55:23 pm
Hy Stramm, first of all thanks for all the great mods!

I'm runnin a CPG 1.4.14
I Just needed this kind of feature, so applied this mod.

Just one problem afer doing all the process described in first post:
In the configuration I change settings of " image watermarking"  but the changes I made dont get memorized.
Each time I get Back to config, the whatermarking is set on NO and the path to the file is deleted....

Tried anyway uploading pictures and they dont get modified.

Some sugestion on where is the little error???
 :o :o
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Stramm on February 01, 2008, 07:18:46 pm
as mentioned in the first post you need to run update.php

Quote
Setup:
just apply the following code, replace include/picmgmnt.inc.php with the attached file and run update.php
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: tinorebel on February 02, 2008, 02:32:00 pm
Thanks Stramm for your support.
Yes, I did run update, I did it twice just to obe shure. :-\

 I then cheched the mod on update.sql file and its fine.

I have installed your photo shop plug in and mini cms plug in....
Could this be the source the problem? ??? ???

I cant understand why configurations obout image watermarking dont get saved....
If someone hase any idea would be very apreciated.
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Stramm on February 02, 2008, 09:00:27 pm
usually these plugins do not interfere. Most times it's that users don't run update.php. Second most reason are mistakes in applying the code.
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Gargoyle on February 03, 2008, 06:05:56 pm
One question:

What can I do to keep the watermark from going onto .gif images only?  You see some of the gifs are animated and the watermarking removes that animation feature. So I would like it to not mark .gifs if possible.

My Thoughts:

Thank you very much for the mod. It works great and is very easy to use.
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: tinorebel on February 04, 2008, 07:10:56 pm
I Just tryed to apply again the mod to see if I could fix the problem. ???

I looked in My Php admin and seems as if the tables needed to run the mod are not present for instance, table : enable_watermark does not exist.

Since I Did run Update, the only posibility must be that i made a wrong mod on the file update.sql right? ???

So my question is: I Modified this file using text edit on mac, just added the following code, as written in first post, closed and saved the file, and uploaded.... where can I be wrong?
....Maby I should use another program to modifie the file?
Dreamweaver will not open the file.... Thanks for your patience!  8)

Code: [Select]
#watermark
INSERT INTO CPG_config (name, value) values ('enable_watermark', '0');
INSERT INTO CPG_config (name, value) values ('where_put_watermark', 'southeast');
INSERT INTO CPG_config (name, value) values ('watermark_file', 'images/watermark.png');
INSERT INTO CPG_config (name, value) values ('which_files_to_watermark', 'both');
INSERT INTO CPG_config (name, value) values ('orig_pfx', 'orig_');
INSERT INTO CPG_config (name, value) values ('watermark_transparency', '50');
INSERT INTO CPG_config (name, value) values ('watermark_transparency_featherx', '0');
INSERT INTO CPG_config (name, value) values ('watermark_transparency_feathery', '0');[/table]
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Stramm on February 04, 2008, 07:43:31 pm
check on the server if it's uploaded correctly
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: tinorebel on February 05, 2008, 01:56:06 pm
Yes, the file hase been uploaded correctly, i cheched twice  into  sql folder...... sql/update.sql
I wanted to find out where is the problem, so I created the missing tables with phpMyAdmin.

Now the settings get saved, but when I upload a file it's unable to put it in the album, ???
I get this error from Iphoto export (plug in for Iphoto to upload pictures to coppermine)

CRITICAL ERROR:
:
A server-side error occurred.
The file 'albums/wpw-20080205/DSC_7449_2_2.jpg' can't be inserted in the album <br /><br />(File: : /mounted-storage/home31b/sub001/sc204/www/website/cpg/xp_publish.php / Line: : 841)

 Critical error detected: The file 'albums/wpw-20080205/DSC_7449_2_2.jpg' can't be inserted in the album <br /><br />(File: : /mounted-storage/home31b/sub001/sc204/www/website/cpg/xp_publish.php / Line: : 841)

Is it a chmod problem?? but I have Albums directory chmodded on 777 as all the included albums!

No idea? ??? ??? ???

Thanks for any sugestion 8)
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Lusch on February 29, 2008, 02:55:58 pm
Is this mod goiing to be updated to CFG 1.4.16? There has been some updates in `picmgmt.inc.php`.
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Stramm on February 29, 2008, 03:55:03 pm
changes from CPG 1.4.15 have been undone in 1.4.16... you always can use the modpack version of picmgmnt.inc.php as it is  up to date
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: CmeNot on March 02, 2008, 07:18:42 pm
new here and sorry if my question is off the wall or seems like something i should already know.

I think I did a fairly good job of going thru this post and tryin to make sure my question has not been asked/answered and i didn't see it...but i did have to go skim thru 15 pages...so there's a possiblity I may have missed it (only human).

But my question is, is there a way to stop ppl from accessing my 'orig_filename.jpg' image without deleting it from the server? i tried different chmod but that didn't work, and i don't want ppl to be able to access my original photos w/o the watermark but i want to keep them on the server just incase i need the original photo @ a later date!

any help/guidance/suggestions would be greatly appreciated! thanks in advance.
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Stramm on March 02, 2008, 07:24:56 pm
on *nix servers you yould use htaccess, eg. something like this... just place a file with the name .htaccess and the following content in your albums folder

Code: [Select]
<Files orig_*>
    Order deny,allow
    Deny from all
    Allow from localhost
</Files>
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: CmeNot on March 02, 2008, 10:58:28 pm
^ OMG! Thanks so much it worked like a charm!  :D
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: Takako on March 03, 2008, 06:57:15 pm
Sorry, I did try to read through as much of the 15 pages, and also tried to search for an answer before I posted.
so hopefully I'm not asking an already answered question~

How do we actually undo the watermarking? is there an actual function for it (like how there is a function to delete the original file in admin tools?)
or does undoing the watermarking involved manually changing all the orig_ file?
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Stramm on March 03, 2008, 08:39:39 pm
Just read the very first post of this thread carefully...
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: ojunco on April 04, 2008, 06:10:57 pm
Can i use the file's mod for 1.4.16 version?
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Stramm on April 04, 2008, 07:15:24 pm
http://forum.coppermine-gallery.net/index.php/topic,29817.msg245065.html#msg245065
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: coolbreeze on April 05, 2008, 07:42:32 pm
Thank you for this MOD. Works great!
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: hkr on April 08, 2008, 09:17:23 pm
i get the foll error while running the sql:

Quote
SQL query:

ALTER TABLE `CPG_filetypes` DROP INDEX `EXTENSION` ,
ADD PRIMARY KEY ( `extension` ) ;

MySQL said: Documentation
#1091 - Can't DROP 'EXTENSION'; check that column/key exists


any suggestions?

thnx..
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Stramm on April 08, 2008, 10:06:54 pm
comment it out (adding # in front of the line)

that's mysql for the standard cpg 1.4.16 update, initially not related to this mod
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: hkr on April 08, 2008, 10:25:27 pm
Thnx al lot, finally it works now, but now when i try to upload a new image i get an error after the upload is done:

Quote
The previous file could not be placed.

You have successfully placed all the files.

did i mess up something in CHMOD the file permissions?

thnx..
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Stramm on April 09, 2008, 12:20:49 am
make sure you followed the instructions to the point... if that doesn't help, start a new thread on the upload troubles board. Follow the upload trouble shooting guide (see docs) and post all necessary info
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: hkr on April 09, 2008, 06:32:07 am
ok thanks, but could you pls tell me if i did something wrong in editing the files, because under admin tools it only shows me " Delete original image backup (watermark mod) (1) " there is no other options, there is no option of watermark already uploaded files as well?

thnx..
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Stramm on April 09, 2008, 07:52:27 am
there are supposed to be more options. So at least this file you should check for errors... maybe verifying all changes is a good idea
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Halfhidden on April 16, 2008, 10:31:08 pm
I have been using this mod without problems... it's fantastic to say the least. However since updating to 1.4.17 I cannot get the mod to work at all. I have tried uploading the old files I used before the upgrade to check if I incorrectly cut and paste the code. And I have recreated the mod using the correct files from the upgrade root. I don't get watermark options in config and no options in admin tools and no watermark on uplaods... can you help please.
Regards,
Steff
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Stramm on April 16, 2008, 10:46:19 pm
Have you switched language to english US to do the settings? Or to thzat language file you've edited?
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Halfhidden on April 16, 2008, 11:05:02 pm
I've just checked to make sure that the language in config is set to enlish rather than english gb..... (so the config matches the file I edited)


Regards,
Steff
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Stramm on April 17, 2008, 12:06:11 pm
use the dropdown selector to make sure you selected english US
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Halfhidden on April 17, 2008, 09:33:43 pm
I did change the language to english from English_gb and saved the configurations in config but the language keeps defaulting to English_gb. So I thought I'll make the changes to the english_gb file rather than the english file... still no luck at all.
I'll post the language change problem in the main support gallery.

Regards,
Steff
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Stramm on April 17, 2008, 10:10:10 pm
this is no problem but expected behaviour. Either change the language with the dropdown selector (that one you can enable in config) or with domain.com/path_to_gallery/index.php?lang=english
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Halfhidden on April 17, 2008, 10:32:58 pm
this is no problem but expected behaviour. Either change the language with the dropdown selector (that one you can enable in config) or with domain.com/path_to_gallery/index.php?lang=english

Sorry about this. I've gone to the root directory of Coppermine and looked at the index.php and cannot see lang=english in the file. And as I said the drop down selector keeps reverting back to english_gb everytime I change it to english, despite clicking on save configuration.

regards,
Steff

PS just to add to the confusion I had 7 uploads ready to be authorised and despite no watermark control panel in config, 5 of the seven watermarked correctly. The other two are completely missing watermarks.
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Stramm on April 17, 2008, 11:51:14 pm
hmm... better read more about selecting the language in the docs http://coppermine-gallery.net/demo/cpg14x/docs/index.htm#admin_language
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Halfhidden on April 18, 2008, 12:11:51 am
I read the documentation you sent me... this I already understood, well mostly anyway. This is where I have been trying to change the language, but to no avail.
Why suddenly is this an issue when I have enjoyed several upgrades on Coppermine?... Yours is not the only mod not working... none of them are in my gallery any longer... nor some plug-in's correctly.

I'm seriously considering downgrading because so many useful mods no longer work and my gallery is disfunctional now.

Thanks for your help anyway Stramm.
Regards,
Steff
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Halfhidden on April 18, 2008, 01:29:22 am
please refer to this link: http://forum.coppermine-gallery.net/index.php/topic,51971.msg252292.html#msg252292

Regards,
Steff
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: John3971 on April 20, 2008, 01:22:55 am
great mod but i wonder how i can changes location on my picture i want it down to the left wich i have choosen and its down to the left but i want it to be a little bit lower on the picture and as much to the left as possible. here is how its now
[Edit GauGau] Replaced hotlinked image with attachment nikivg2.jpg [/Edit]
and here is an example of how i want it
[Edit GauGau] Replaced hotlinked image with attachment file.php.jpg [/Edit]
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Stramm on April 20, 2008, 12:43:32 pm
great mod but i wonder how i can changes location on my picture i want it down to the left wich i have choosen and its down to the left but i want it to be a little bit lower on the picture and as much to the left as possible.

http://forum.coppermine-gallery.net/index.php/topic,50450.msg242984.html#msg242984
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: John3971 on April 20, 2008, 05:24:04 pm
http://forum.coppermine-gallery.net/index.php/topic,50450.msg242984.html#msg242984
thanks.
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Halfhidden on April 21, 2008, 11:36:04 am
Hi Stramm. Apologies for my post earlier it was premature and unnecessarily finger pointing. it seems that english_gb was to blame and once removed the watermark worked as expected.  I created a fresh install to deal with the other mods. However I've noticed that when I replace picmgmt.inc.php with your copy to enable watermarking all users on the board are allowed uploads without approval regardless how their rights are set in config. Because I've moved my gallery to a new server I checked the entries in the database (usergroups) to make sure that the settings in config had populated to the appropriate tables, and they had. I then eliminated all other edited files from the mod and was left with the picmgmt.inc.php. If I replace the mod version of picmgmt.inc.php with the current copy from Coppermine, approvals work fine.... but the watermark obviously wont. I then replaced the picmgmt.inc.php with the copy downloaded from your mod and the watermark worked but upload rights were ignored and anyone could upload without approval.
I'm currently running version 1.4.18
Regards,
Steff
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: dev0 on April 23, 2008, 04:39:51 am
I was wondering if you could make a new -> picmgmt.inc.php <-

One thats up to date with the current coppermine, cause as of now, i can only upload files with some size (over 600kb) with the original picmgmt file, and i can only add watermarks with the one you provided.. 

Big files with the modded picmgmt file just errors out when uploaded or batch added, and if i replace it with the standard one it works fine after a F5 ;)


Any help would be apreciated

-Leo
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Stramm on April 23, 2008, 08:09:06 am
changes from CPG 1.4.15 have been undone in 1.4.16... you always can use the modpack version of picmgmnt.inc.php as it is  up to date

there hasn't be changed much... after all, watermarking needs a good bunch more memory. So if you're on low mem (it doesn't depend on size in k but width x height x color depth) that can reduce the size you can upload, too.
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Halfhidden on April 23, 2008, 12:49:59 pm
  I created a fresh install to deal with the other mods. However I've noticed that when I replace picmgmt.inc.php with your copy to enable watermarking all users on the board are allowed uploads without approval regardless how their rights are set in config.
I'm currently running version 1.4.18

I've replaced the picmgmt.inc.php with the copy from your latest mod pack and the watermark mod works perfectly. Permissions work as expected and watermarks are place in the correct portion of the image, whether uploaded by batch or  otherwise.
Thanks for your help,
Regards,
Steff
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: coolbreeze on April 26, 2008, 05:41:38 pm
This is one of the best mods I have ever used. Even the ability to update all images with teh watermark worked flawlessly.


Thank you!!!

Cool
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: smithyonline on May 14, 2008, 10:22:08 am
ok love the look of this mod so have tryed installin it and had no problem with the codes and the gallery still works fine but nothing has changed

did a versioncheck and it comes up sayin that im usin version 1.4.18 and the include/picmgmt.inc.php is 1.4.5

could this be my problem and how do i fix it?
Thanks
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Stramm on May 14, 2008, 11:57:08 am
It's a good idea to read the thread you post in as most of your questions may have benn asked by other users before. Your questions are covered on the last page. If these users would have read the previous page, too, they most probably may have found the answer there as well.
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: smithyonline on May 14, 2008, 12:45:24 pm
It's a good idea to read the thread you post in as most of your questions may have benn asked by other users before. Your questions are covered on the last page. If these users would have read the previous page, too, they most probably may have found the answer there as well.

sorry i did have a scan over the full topic but with 17 pages it easy to miss somethin
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Stramm on May 14, 2008, 12:52:14 pm
true... but as said, the last page...
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: DJ-Marcuzz on May 18, 2008, 02:45:46 pm
Hi,

I love the mod, but i have one big problem, it destroys the Exif data, and i really want that data to be present in the image info.
Is there any way to save the Exif data from destruction?

Greets, Marcus
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Joachim Müller on May 19, 2008, 06:37:45 pm
No, as the image libraries used by coppermine (GD or ImageMagick) both are not capable to preserve/write exif information. You'll have to live with this. Your best option is to watermark locally (on your client) before uploading the pics to your gallery in the first place.
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: DJ-Marcuzz on May 19, 2008, 07:05:35 pm
Ok, this is like an big bummer!
Could you recommend me any tools for watermarking and resizing locally?
We will have to live with this problem, but we have to resize about 600 pictures per shoot to 1024, watermark them, resize the original to 640, watermark them, and resize the original to 100 and upload the tree.

Greets, Marcus
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Joachim Müller on May 20, 2008, 08:47:52 am
I have posted in several threads already my recommendation for local watermarking:
As not all watermarking utilities preserve exif information, you could use the tool Tools recommended by the devs -> Exifer for Windows (http://forum.coppermine-gallery.net/index.php/topic,31423.msg145477.html#msg145477) to back up your exif information before applying the watermark and then restoring the lost exif data afterwards.
Not related to this thread - please do not clutter this thread further with your questions on local watermarking. If you need to discuss this in detail, use the thread How do you resize your pictures? (http://forum.coppermine-gallery.net/index.php/topic,12246.0.html).

Joachim
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: bogski on May 22, 2008, 04:28:27 am
After updating my 1.4.16 with 1.4.18 which file (picmgmt.inc.php) will be compatible? The version of picmgmt.inc.php I got is 1.4.6. Is it ok if I over right my picmgmt.inc.php 1.4.18?
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Stramm on May 22, 2008, 10:27:39 am
Read this thread, especially the last two pages
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Eclipse on May 30, 2008, 03:08:31 am
Thanks for the great mod! It works perfectly.

One question, you say it comes with undo possibility. How do I get back the original (unwatermarked) images?
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Stramm on May 30, 2008, 09:26:23 am
It's in the first post of this thread ;)

Quote
To undo watermarks just disable watermarking in config and run the admin tools.
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: xXTReMEXx on June 14, 2008, 02:26:14 am
hi stramm, i've read all the instructions and done all the required changes, the only part i've stuck was at

admin.php > replace the entire function update_thumbs() with the one u provide

coz i don't know where to end in the original admin.php...  ???

any help is greatly appreciated..

btw.. a very cool hack..;)
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: xXTReMEXx on June 14, 2008, 02:33:43 am
hi stramm, i've read all the instructions and done all the required changes, the only part i've stuck was at
util.php > replace the entire function update_thumbs() with the one u provide
coz i don't know where to end in the original util.php...  ???
any help is greatly appreciated..

btw.. a really great hack..;)
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: xXTReMEXx on June 14, 2008, 02:35:47 am
sorry, pls delete my 1st post... it's all wrong.. :-[
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Stramm on June 14, 2008, 11:10:31 am
It ends right before the next function declaration (function del_orig()). Also the indentation should be able to help you.
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: xXTReMEXx on June 16, 2008, 11:17:32 pm
It ends right before the next function declaration (function del_orig()). Also the indentation should be able to help you.

thx very much Stramm, it all works great now..
xcept for this Buddy problem.
Im using SMF 1.1.5 & Coppermine 1.4.18,
I've enabled the Buddy settings in my Forum, & had setted some members in my Forum as Buddy,
I've Enabled the Buddy List in the Coppermine Config & have setted My Albums permission for My Buddy & Some Group... But when i clicked on My Friends to view my buddy, it shows 0.. no Buddy nor Friends..
& also My Buddies that I've added in the Forum were not able to view my albums that i've given them permission to view..
u hav any clue..??
thx again for yr support...
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Stramm on June 17, 2008, 07:35:31 am
buddies don't get bridged... there are independent smf and cpg buddies (if you use the modpack)
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: xXTReMEXx on June 20, 2008, 01:46:00 pm
buddies don't get bridged... there are independent smf and cpg buddies (if you use the modpack)

o.i.c... thkx 4 the info
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: GsJosh on July 15, 2008, 12:12:27 am
First of all, great mod! It's quite some work but it does some nice things. This helps me save time because it eliminates the time I have to spend adding the watermarks with a photoshop action. But unfortunately, GD2 edits the image and normally simple programs or scripts tend to make the pictures look bad. That's exactly why I don't let coppermine resize my images. I just upload them in the size I want to have them on the web. What are your experiences? Does GD2 make the pictures look worse? I can't check for myself since I'm having trouble with the mod.

Because although I did the modifications correctly (twice), it's still not working. I can see the Watermarking options in the configuration file but when I batch add images the watermarks do not appear in the images. What could be the problem here? I have updated to the last version (1.4.18) and I'm also using the correct picmgmt.inc.php (from the latest Stramm modpack) and it seems that I have added all the code the right way.

All I can say is that I also have the Shopping cart running, but as said before, that shouldn't interfere with the watermark mod. Can someone help me? Do I need to provide additional information?


Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: Stramm on July 15, 2008, 12:16:09 am
asked several times in this thread and all over the forum... change permission of your 'to batch add' images to 644 or 666, folder to 755 or 777.
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: GsJosh on July 15, 2008, 01:10:12 am
asked several times in this thread and all over the forum... change permission of your 'to batch add' images to 644 or 666, folder to 755 or 777.
I feel pretty stupid. At the moment you posted this I wanted to tell you that I found the solution already. It was indeed the permissionproblem. Sorry for that.

Still, I'm having some problems here. Not problems actually, but some questions. First, I don't need the original files. I keep those on my computer here so those extra files just take (a lot) of extra space on my webserver. Is there a way to not make those orig_ files?

Besides... As I said in a post earlier, GD makes your images look really really bad (or maybe it's not GD but something else I did?). I have 3 examples here including the original files. Take a look at what huge differences GD makes. Especially the exposure of pictures is changed (lighter) but also get the idea details and compression are affected. http://temp.tgroen.nl/GD_ugly.zip

Please tell me your experiences with this!
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: GsJosh on July 15, 2008, 02:00:42 am
Since I can't edit posts I will have to make another reply. I have actually found out that GD2 is not the best image script there is. It makes pictures lighter and less contrastfull. Here is a topic on a forum confirming that. (http://www.pixariacentral.com/viewtopic.php?t=2304&sid=49d42e5a83e85fe0e29dad2be8c32c67) It seems that GD2 strips the colorprofile. In firefox the difference might not be as visible but in Safari for example the difference is big. At least, too big for me to be able to use this in my photography. Is there any possibility that this mod will be availible with ImageMagick? Or does IM not support watermarking?
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Joachim Müller on July 15, 2008, 06:58:52 am
You'll get best results if you resize your pics on your client and apply the watermark on the client as well (before uploading). Server-sided image manipulation always has to be a compromise in terms of resources consumption.
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: Stramm on July 15, 2008, 08:14:40 am
Somewhere within this thread (~ first 10 pages) I've described how to mod the script so it won't create original files. I've had a look at your pics and have to say that a loss of image quality is pretty normal as images get recompressed when being resized. In the config panel you can chose the recompression value (image quality). Maybe it helps a lil bit. However in my book your (resized) pics look good and I can't find lots of differences to the orig. I guess cause I still remember the first pics you could see in the net. These were compressed to the absolute minimum filesize and really looked ugly. Also you may know your images far better than I do (just had a quick view).
As Joachim said. Best results you achive if you resize/ watermark manually using eg. Photoshop. You in addition to resizing can apply (partially) filters where necessary.
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: GsJosh on July 15, 2008, 11:59:40 am
You'll get best results if you resize your pics on your client and apply the watermark on the client as well (before uploading). Server-sided image manipulation always has to be a compromise in terms of resources consumption.
Thanks, I guess that both ImageMagick and GD2 have significant image quality loss. But the thing that worries me the most is that GD2 strips the EXIF as well as the color profile, now that's a shame. But that's not concerning this topic.

Somewhere within this thread (~ first 10 pages) I've described how to mod the script so it won't create original files. I've had a look at your pics and have to say that a loss of image quality is pretty normal as images get recompressed when being resized. In the config panel you can chose the recompression value (image quality). Maybe it helps a lil bit. However in my book your (resized) pics look good and I can't find lots of differences to the orig. I guess cause I still remember the first pics you could see in the net. These were compressed to the absolute minimum filesize and really looked ugly. Also you may know your images far better than I do (just had a quick view).
As Joachim said. Best results you achive if you resize/ watermark manually using eg. Photoshop. You in addition to resizing can apply (partially) filters where necessary.
You see? One should read more carefully, the solution for the original files was already in the topic, I just skipped over it. Anyway, thanks! This has solved all my problems concerning the watermarking mod. Still I'm a bit hesitate full if I'll use this fantastic mod. Your tip about changing the image compression is a good one, I'll try that. But still, the loss of color profile is huge when you're surfing around with a color profile enabled browser like Safari. The output differs somewhat between the program's you use to view the images with. Here's an example of the difference in Safari (screenshot):

http://temp.tgroen.nl/Picture-4.jpg

http://temp.tgroen.nl/Picture-4_difference.jpg

Anyway, this doesn't belong in this topic and I'm sorry for that but I just wanted to point out the obvious downside to using this mod. Nevertheless, it's a great mod and you should continue creating more genius stuff like this!
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: kylemj on July 20, 2008, 03:27:30 pm
hmm isnt watermarking on the larger image when using the batch add files function
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: Stramm on July 20, 2008, 07:33:07 pm
Look for the solution within this therad. Has been asked and answered several times
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: Jules2008 on July 22, 2008, 04:49:19 pm
Better late than never

I have used this mod and everything seems perfect however I change the config settings in cpg and they say they have changes but they haven't.... I go back in and the config still says the watermark is turned off etc....

I have checked and double checked all the changes in the files as directed.....

What am I missing

Jules

Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: Jules2008 on July 22, 2008, 05:01:24 pm
Better late than never

I have used this mod and everything seems perfect however I change the config settings in cpg and they say they have changes but they haven't.... I go back in and the config still says the watermark is turned off etc....

I have checked and double checked all the changes in the files as directed.....

What am I missing

Jules



Ignore me............. It is very late and I need sugar.... solvd this problem by reading.... Duh!!!!!!!!!!!!
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: lostemilie on July 29, 2008, 10:18:30 am
you'll have to modify picmgmnt.inc.php
delete
Code: [Select]
if (!file_exists($orig) && $CONFIG['enable_watermark'] == '1' && ($CONFIG['which_files_to_watermark'] == 'both' || $CONFIG['which_files_to_watermark'] == 'original'))  {
// if copy of full_sized doesn't exist and if watermark enabled and if fullsized pic watermark=true -> then we need a backup
if (!copy($image, $orig))
                return false;
else
$work_image = $orig;
}

not tested, no guarantee ;)
after that modification you're not able to undo the watermarking
I tried that and now always get an error when uploading pics so I had to undo it. Anyone who knows how to put it off??
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: taf on July 29, 2008, 11:04:05 pm
hi stramn,
i add this hack to my copprmine galery,
on the admin i see the config of the water mark,
but when i change the config of the watermark.
this dont do nothing.
and when i go back to the config i see that he did not changed nothing..
why this happen?
thanks alot
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Stramm on July 30, 2008, 10:47:53 am
I tried that and now always get an error when uploading pics so I had to undo it. Anyone who knows how to put it off??

This is not really something I call a good problem report. Therefore I doubt anyone will be able to help you.
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Stramm on July 30, 2008, 10:49:00 am
hi stramn,
i add this hack to my copprmine galery,
on the admin i see the config of the water mark,
but when i change the config of the watermark.
this dont do nothing.
and when i go back to the config i see that he did not changed nothing..
why this happen?
thanks alot

Did you run update.php as mentioned
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: lostemilie on July 30, 2008, 01:12:49 pm
This is not really something I call a good problem report. Therefore I doubt anyone will be able to help you.
When I add images I don´t get the OK button but a click here to reload thing and it said that there is an error in the file I changed :(
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: Stramm on July 30, 2008, 01:30:14 pm
then you probably made a mistake... try applying the changes again
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: taf on July 30, 2008, 09:02:31 pm
Did you run update.php as mentioned

lol,
now the sql added :)
but actully the water mark dont show..
i active the watermark.
and changed the path of the image watermark..
but stil doesnot work..
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: Stramm on July 30, 2008, 09:54:36 pm
Carefully read the first post again... this is not an 'on the fly watermarking mod' but a 'permanent' one.
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: morgue on August 29, 2008, 12:17:55 pm
Great mod, it's really useful..

But I'm having a little problem with a couple of albums, and I don't know why.. I'm getting a white screen when running the Update option in admin tools... It worked for every album but those two, and one of those I really need those two to have watermarks :( ... The website is http://maracaibodenoche.byethost7.com/album/index.php

The only thing I have is the link that comes up when the screen goes white, which is: http://maracaibodenoche.byethost7.com/album/util.php?numpics=5&startpic=45&albumid=2&autorefresh=1&action=update_thumbs&updatetype=3

I checked the log but there's nothing, just failed login attempts :)

I don't know if it can be solved, but I'd appreciate any input from you guys... Thanks!

And again, amazing mod :D
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: Stramm on August 29, 2008, 12:38:15 pm
usually the reason is not enough php memory (memory_limit in php.ini)
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: morgue on August 29, 2008, 03:49:56 pm
hmmm I don't think I can change that on my free hosting account, can I?
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: morgue on August 29, 2008, 03:55:19 pm
or skip the ones that have a watermark already?
idk...
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: augustin on September 04, 2008, 01:45:52 am
Hi there.

Was wondering if anyone else had this problem and what resolved it.

I am running 1.4.18

I installed the mod, changing the files needed and replacing the picmgmnt.inc.php file with the new one. I ran the update.php.

I then went to config and set the path to my .png file and enabled watermarking.

The rpoblem is that when all was done images were not there any more. Just little gray boxes instead of the thumbnail pics that were clickable and still no image in large image page.

I backed up files so nothing was lost.

Thanks
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: uglycars on September 16, 2008, 05:59:33 am
after doing your mod, I get this error when trying to delete a photo from the gallery:

Fatal error: Cannot redeclare output_table_header() (previously declared in /homepages/40/d237348395/htdocs/uglycars/photo/gallery/delete.php:34) in /homepages/40/d237348395/htdocs/uglycars/photo/gallery/delete.php on line 51
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: Stramm on September 16, 2008, 07:23:16 am
Make sure you did the modifications exactly as described.
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: oxygen on September 16, 2008, 03:13:56 pm
Doesn't work on my CPG. I am running 1.4.19 and I've done these modifications about five times now and always reached the same point. Everything looks like it should. But when I try to enable it [Config => Image watermarking => Watermark image => Yes => Save new configuration] nothing changes. When I look again to the Image watermarking page under my configuration tab the little blue dot that I just had put into the 'yes' box is still in the 'no' box.
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: Nibbler on September 16, 2008, 07:54:22 pm
You need to run update.php for the database changes to take effect. I think that's missing from the instructions.
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: vglick on September 16, 2008, 09:18:22 pm
I have successfully installed this mod http://forum.coppermine-gallery.net/index.php/topic,29817.msg137993.html#msg137993 and a mod for the mod http://forum.coppermine-gallery.net/index.php/topic,29817.msg143122.html#msg143122
All is working fine aside from resizing. I have cpg 1.4.9
Please help me. Sorry for my poor English  :)
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: Stramm on September 16, 2008, 10:39:34 pm
upgrade to 1.4.19, then post a link to your site and all your watermarking settings
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: uglycars on September 16, 2008, 11:42:33 pm
I'm able to delete photos now.  I added below a section of code where I was supposed to replace with...all fixed now.  Just waiting on my watermark image my friend is making and hopefully she works like a charm!

Thanks!
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: oxygen on September 17, 2008, 03:23:09 pm
Now I'm having quite strange anomaly. Everything works and watermark shows up on some of the images. But on most of the images it doesn't. I have updated all albums from admin tools. Watermark also shows up on images I upload. And as strange as it may sound the problem only seems to occur with older images in my gallery. Newer images are all OK. Look at this album for example. http://oxygen.pri.ee/thumbnails.php?album=12
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: Nibbler on September 17, 2008, 03:35:11 pm
Check the permissions on the files. They need to be writeable for admin tools to update them.
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: oxygen on September 17, 2008, 04:18:30 pm
Sorry but how do I do that? :-[
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: oxygen on September 17, 2008, 04:30:11 pm
OK cancel that. I understood later what permissions you're talking about. My bad.
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: uglycars on September 17, 2008, 11:40:23 pm
could someone please attach a util.php file?  Mine is all corrupt and I can't find it in the coppermine downloads to replace it.
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: uglycars on September 18, 2008, 03:51:14 am
got a fresh util.php file..thanks
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: uglycars on September 18, 2008, 04:01:04 am
ok, when running the admin tools to update thumbs/or resized photos I receive this error after it runs for a bit.

Error 500 - Internal server error

An internal server error has occured!
Please try again later.

I have the following selected:
Both resized and full sized (if a orig copy is available)
Number of processed images per click  (had it set on 1,2,5)
Auto refresh is checked
had it do my smallest album first
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: Stramm on September 18, 2008, 08:37:04 am
Make sure you followed the instructions to the point.
Make sure your php settings are sufficient to do resizing, watermarking (memory limit)
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: uglycars on September 18, 2008, 05:31:28 pm
I read the instructions about 3X and redid the mod at least twice.

This is what my phpinfo says as far as my memory limit.

memory_limit   40M   40M

What other info do you need and/or what can I do to get this fixed.
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: Stramm on September 18, 2008, 06:10:21 pm
size of the pic you're trying to resize and/ or watermark (width, height)
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: uglycars on September 18, 2008, 09:21:29 pm
the sizes vary..I have no definite sizes.....you can take a peek at the site...

http://www.ugly-cars.com/photo/gallery/

I can make a test account for you if you'd like.
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: uglycars on September 19, 2008, 03:59:25 pm
watermark is 257px X 54px @ 1.84kb in size.

pics vary in size, as I mentioned.

Album Folders/subs are 777 and the pics inside the albums are 666.

still giving me 500 internal errors while running the process.
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: Stramm on September 19, 2008, 04:12:34 pm
try uploading a small and a huge! (huge in width x height) pic. The small shouldn't be a problem. The huge most probably will spit out the error... means you've a pic in your gallery that's to large to watermark. And that means you need to increase memory limit.
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: uglycars on September 19, 2008, 05:40:35 pm
Ok, I'll set up a new album with 1 small image and 1 large image then run the admin tools to watermark the images. 
In the mean time, how do I change the memory limit?
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: Stramm on September 19, 2008, 06:18:06 pm
You do not need to setup a new gallery... just upload (http is enough) the 2 images to your existing gallery. The admin tools use the same functions to resize / watermark as the standard upload.

To learn more about memory limit read the sticky thread(s) in the upload troubleshooting board
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: uglycars on September 20, 2008, 01:29:58 am
it's not working even on small photos under 100kb..I'm giving up I guess.  I don't have time to go through the entire coding process to redo everything to see the same output.
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: uglycars on September 20, 2008, 02:39:58 am
these are my default values in the php.ini file...

The php.ini file contains the following default values:
upload_max_filesize:20 M
max_execution_time:300
memory_limit:40 M
post_max_size:8 M
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: uglycars on September 20, 2008, 02:54:09 am
scratch it..got it working..had an error with the image file.

thanks!
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: bibendum on September 24, 2008, 04:00:58 pm
Hi

Work perfectly on 1.4, thanks for this work.

Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: uglycars on September 26, 2008, 12:33:46 am
grrr...nvm, it's throwing off the error again...I posted the php info for my server.
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: uglycars on September 26, 2008, 12:41:02 am
these are my default values in the php.ini file...

The php.ini file contains the following default values:
upload_max_filesize:20 M
max_execution_time:300
memory_limit:40 M
post_max_size:8 M
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: Stramm on September 26, 2008, 09:42:50 am
Have you read what I've written above??
Then post results!
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: uglycars on September 26, 2008, 05:02:53 pm
I have tried all you suggested.

I have uploaded a small image and a larger image.

The watermarking works on my album with 2 photos, but won't work on my smallest album that isn't a test album with approx 80-90 photos.  it times out half way through.

I have also posted the default php.ini settings for my web hosting server....

seems like the php.ini is all more than enough for what is recommended...

what's next?
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: vglick on September 27, 2008, 03:44:21 pm
upgrade to 1.4.19, then post a link to your site and all your watermarking settings
I upgraded the gallery to 1.4.19, but the resizing isn't working.
Please see here http://www.diving-club.com/gallery, but my site is in Russian.
This is my watermarking settings:
Quote
Which file to use for watermark - images/watermark.png         
Transparency 0-100 for entire image - 100       
Downsize watermark if width of an picture is smaller than entered value. That is the 100% reference point. Resizing of the watermark is linear (0 to disable) - 50       
Set color transparent x (GD2 only) - 0       
Set color transparent y (GD2 only) - 0
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: uglycars on September 29, 2008, 09:19:40 pm
Stramm..is there anything else I can do to help you troubleshoot this issue?

I really am wanting to use this watermark mod!

Thanks...
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: Stramm on September 29, 2008, 09:38:17 pm
I upgraded the gallery to 1.4.19, but the resizing isn't working.
Please see here http://www.diving-club.com/gallery, but my site is in Russian.
This is my watermarking settings:

set 'Downsize ... ' to something realistic like 800 - 1280 (that's the width the watermark should have it's full size; if an image is smaller, the watermark gets reduced in size)
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: Stramm on September 29, 2008, 09:44:29 pm
Stramm..is there anything else I can do to help you troubleshoot this issue?

I really am wanting to use this watermark mod!

Thanks...

Post more info... you can see where the error approx happens and maybe find out the file that makes the trouble. It may be to big (40mb are enough for ~2400px * 2000px) or corrupted. Then it won't work of course. If you use a huge watermark size reduces, too.

On some systems I've seen that they need twice the mem as they hold the pic two times in mem (original, a copy that's getting resized and watermarked). In such a case you have to increase memory limit or upload smaller images (in size)
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: uglycars on September 30, 2008, 12:47:40 am
The watermark is 3.51KB 100X74px.

The error is random, so it's hard to pinpoint when it's going to happen.  Sometimes it happens quick, sometimes it happens after a bit.

I'll try increasing the memory limit to 80mb and post back...
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: uglycars on September 30, 2008, 01:35:51 am
I had a friend look at the gallery who writes php and said the error is happening somewhere in the upload.php....

Here's my upload.php...as far as I know, it's the default file...

http://pictures.ugly-cars.com/MISC/misc/upload.php
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: vglick on September 30, 2008, 10:49:48 am
set 'Downsize ... ' to something realistic like 800 - 1280 (that's the width the watermark should have it's full size; if an image is smaller, the watermark gets reduced in size)
Oops, I am understand now where my mistake. Thank you for your mod, it working fine now.
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: ksxj on October 02, 2008, 02:35:17 am
Great mod!! 

Is ther anyway to have the watermark show for some groups and not for others?
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: mystifiedlala on October 09, 2008, 02:25:34 am
Hey guys, this mod is great but I wonder why isn't working on original files only on medium pics?
What I'm doing wrong?
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: Halfhidden on October 09, 2008, 02:38:32 am
I seem to remember that the reason why the watermark used the normal picture rather than the original pictures was for its undo facility, if the original were used it would not be possible to restore the pictures to normal (without the watermark)
That is unless I've misunderstood your question.
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: mystifiedlala on October 09, 2008, 02:46:54 am
oh no hehe
I just wanna tag Original pictures or at least the HQ  big ones not the intermediate.
But it seems on my gallery, they're only working with the intermediate and not with the originals. lol
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: Halfhidden on October 09, 2008, 02:57:48 am
I would suggest checking your code again. Stramms mod watermarks all levels except the originals because of the reasons I explained above. If the watermark shows up on the normal images then it should show up on the larger images. I use this code on 11 sites without problems.
Perhaps Stramm can shed some light on this.
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: Stramm on October 09, 2008, 09:05:26 am
Read this thread, it has to do with permissions and has been asked and answered lots of times.
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: uglycars on October 20, 2008, 07:12:06 pm
I still can't get the mod to work properly on my gallery...I'll probably just install it.
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: Daino on November 14, 2008, 01:33:26 pm
Hi all, I'm sorry for my bad english.
I'm currently using Coppermine 1.4.19 with this bridge for phpbb3 (http://forum.coppermine-gallery.net/index.php/topic,53678.0.html), that is going very well for the moment.
I'm asking me this: can I use this watermark mod for my gallery? The ModStramm Pack is not compatible with phpbb3 bridge that I'm using, and I don't know if this mod is good for my necessity or not. So I can't momentaneally make a watermark to my pictures. How can I do?
Thank you very much for helpening.
Regards
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: Stramm on November 14, 2008, 06:19:10 pm
Nothing brisge related is used for this mod... just try it.
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: Cath22 on November 20, 2008, 12:28:20 am
Hello, is it possible to have two separate watermarks, like on in the corner and other in center, since using a picture that contains two watermarks never really gets the right result.

Thanks in advance
Cath
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: Cath22 on November 20, 2008, 10:50:07 am
Hello, is it possible to have two separate watermarks, like on in the corner and other in center, since using a picture that contains two watermarks never really gets the right result.

Thanks in advance
Cath

Never mind, after some searching I found another watermark plugin which has several possibilities and it works seamlessly together with this one. That works for me hihi.

Greetz
Cath
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: koko_426 on November 22, 2008, 05:47:34 pm
Hello Stramm
I think I've got a problem here which I can't fix without your help

What I did:
1) I replaced and added all the lines and all the files you had listed
2) I uploaded the picmnmt.pic.php
3) I ran update.php

What happens is that in the config section there have appeared the Image Watermarking section, it seems to be working. But when I click on the "Admin tools" button (following the http://name_of_my_site/util.php),  I keep getting completely blank screen, Nothing works. I checked all thу lines in the mod again - there seems to be no mistakes. Where have I made a mistake? Does it have anything to do with the chmod settings for php files?

Please give any hint if possible. Thanks a million

Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: Stramm on November 22, 2008, 06:06:01 pm
please zip and attach util.php to your next post
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: koko_426 on November 23, 2008, 07:52:11 pm
Sorry, maybe it was my mistake. I reloaded everything the second time, uploaded and ran the update again and now it works. Thank you very much, seems to be a very useful thing.
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: armsve on November 28, 2008, 01:28:34 am
Works like a charm. Thanks for the good work :)
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: Gorgias on December 09, 2008, 09:59:35 pm
Hello!

I'm trying undo the watermark, but I can't. After search and test, and more search and test... I found and read this Stramm instruccions in this message (http://forum.coppermine-gallery.net/index.php/topic,16286.msg97318.html#msg97318):
Quote from: Stramm
So if you turn off watermarking in config and rebuild normal and fullsized pics then they won't have watermarks anymore.

So I did it: I turn off the watermarking in Config, and in Admin Tools, I check "Update thumbs and/or resized photos (1)" and inside, "Both resized and full sized (if a orig copy is available)". But then, the watermark still is shown. Am I doing the correct proccess? I think I'm doing something wrong. I checked CHMOD, and I think are correct. I don't know what is happening.

You can see my test gallery in http://www.forocompeticion.com/test/copper/, and the examples of images (thumb, normal and original without watermarking, and the image with watermark), are attachment in a zip. If you need a test admin user, please, tell me.

Thank you in advance!

Regards!
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: ohbelanova on December 15, 2008, 10:14:24 pm
i got this error :/
Code: [Select]
Parse error: syntax error, unexpected T_FUNCTION, expecting '{' in /home/ohbelanova/domains/ohbelanova.com/public_html/galeria/admin.php on line 704
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: Stramm on December 15, 2008, 10:22:32 pm
recheck the modifications you did within admin.php
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: ohbelanova on December 15, 2008, 11:32:56 pm
when i add this code to admin.php it gives me the error
Code: [Select]
function form_watermark($text, $name)
{
   global $CONFIG, $lang_admin_php;

   $value = $CONFIG[$name];
   $southeast_selected = ($value == 'southeast') ? 'selected' : '';
   $southwest_selected = ($value == 'southwest') ? 'selected' : '';
   $northwest_selected = ($value == 'northwest') ? 'selected' : '';
   $northeast_selected = ($value == 'northeast') ? 'selected' : '';
   $center_selected = ($value == 'center') ? 'selected' : '';

   echo <<<EOT
       <tr>
           <td class="tableb">
                       $text
       </td>
       <td class="tableb" valign="top">
                       <select name="$name" class="listbox">
                               <option value="southeast" $southeast_selected>{$lang_admin_php['wm_bottomright']}</option>
                               <option value="southwest" $southwest_selected>{$lang_admin_php['wm_bottomleft']}</option>
                               <option value="northwest" $northwest_selected>{$lang_admin_php['wm_topleft']}</option>
                               <option value="northeast" $northeast_selected>{$lang_admin_php['wm_topright']}</option>
                               <option value="center" $center_selected>{$lang_admin_php['wm_center']}</option>
                       </select>
               </td>
       </tr>

EOT;
}
// Added for allowing user to select which files to watermark...
function form_watermark2($text, $name)
{
   global $CONFIG, $lang_admin_php;

   $value = $CONFIG[$name];
   $both_selected = ($value == 'both') ? 'selected' : '';
   $original_selected = ($value == 'original') ? 'selected' : '';
   $resized_selected = ($value == 'resized') ? 'selected' : '';

   echo <<<EOT
       <tr>
           <td class="tableb">
                       $text
       </td>
       <td class="tableb" valign="top">
                       <select name="$name" class="listbox">
                               <option value="both" $both_selected>{$lang_admin_php['wm_both']}</option>
                               <option value="original" $original_selected>{$lang_admin_php['wm_original']}</option>
                               <option value="resized" $resized_selected>{$lang_admin_php['wm_resized']}</option>
                       </select>
               </td>
       </tr>

EOT;
}

 what i do to resolve this error?

Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: Stramm on December 16, 2008, 08:35:39 am
zip your modded admin.php and attach it to your next post
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: MikeFL on December 20, 2008, 05:31:47 am
22 pages on this thread.  Amazing.  I hope I didn't miss the solutions to my problems (below).

This mod keeps the original image stored, before the watermark was added.  (?right?)

I would like to use a payment mod on my gallery.  Is there a payment mod which can be used with this watermark mod - to grab the pre-watermarked image?

I found a quirk after installing the mod when using the import_gallery2 mod (from Menalto Gallery).  If importing images while watermarking is turned on in config, there is a database error after a couple minutes (database went to sleep?).  Turning watermarking OFF solves this and the images import.

I'm getting errors when trying to add the watermark:

Updating thumbnails and/or resized images, please wait...
albums/rainier/normal_MtRainierTour114c.jpg updated succesfully!
ERROR creating:$image
albums/rainier/normal_MtRainierTour087c.jpg updated succesfully!
ERROR creating:$image
albums/rainier/normal_MtRainierTour083c.jpg updated succesfully!
ERROR creating:$image
albums/rainier/normal_MtRainierTour081c.jpg updated succesfully!
ERROR creating:$image
albums/rainier/normal_MtRainierTour063c.jpg updated succesfully!
ERROR creating:$image

Finished updating thumbs/ images!

My folder is CHMOD 777 and the files within it are 666

When I go to view the album, no thumbnails appear - just the filename/title and description.  The filename/title is not a link.

Thank you for the help and assistance!
Mike
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: Heroe on January 13, 2009, 09:51:59 am
Hello i been reading for the watermark about 50 pages (batch upload and replace files) and 10 for file permission,im getting  ??? do i read ore not solution for my watermark problem ... I upload and install the stramm's bridge 1.4.19 last night and all night i being searching for solution about my problem
my gallery version is 1.4.19
and this are my watermark options in config /

Watermark Image      Yes     No      
Watermark custom thumbs (movie, audio, document)    Yes    No    
Where to place the watermark    Bottom right
Which files to watermark            Both
Which file to use for watermark    images/watermark.png
Transparency 0-100 for entire image    50   
Downsize watermark if width of an picture is smaller than entered value. That is the 100% reference point. Resizing of the watermark is linear (0 to disable)            0

all functions seems work correct

but my watermark appear very small on original pictures

link to the gallery http://abroadbg.com/index.php

test account

user: test
password: 123654

if you want to check what i mean
for example:
http://abroadbg.com/displayimage.php?album=4&pos=-121
( the watermark appear grate the perfect size)

http://abroadbg.com/albums/userpics/10001/4/dsc00586.jpg
(the watermark appear too small :(  you cannot see at on the dark photos )


is it possible somebody to help ?

Sorry if the question is stupid but i'm not sure which options i need to change in my config
99% im sure i need to change 
Files and thumbnails settings >>Max width or height of an intermediate picture/video **  400 to ++
but i want to ask first here  :)
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: Stramm on January 13, 2009, 10:00:23 am
The watermark function is working as expected.
Eg. here's a watermarked fullsized picture from your gallery http://abroadbg.com/albums/userpics/10001/17/DSCN0785.JPG

see, the watermark has exactly the dimension you ask for. However your additional mod sizes down the fullsized pic and therefore the watermark seems to be smaller also (even if it isn't).

Solution: reduce the size of your fullsized images to the display size (you actually show within graybox [is that it?])
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: Heroe on January 13, 2009, 11:22:07 am
Thank you for the fast reply Stramm i have installed on my gallery the      
LightBox JS for Fullsize Popup Slideshow  (http://forum.coppermine-gallery.net/index.php/topic,49596.0.html)
could you tell where in the config options is the reduce size for fullsized images because i cant find at anywhere,if you have time ofcourse  :)

 

Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: Stramm on January 13, 2009, 12:32:25 pm
http://coppermine-gallery.net/demo/cpg14x/docs/index.htm#admin_picture_thumbnail

Max width or height for uploaded pictures (pixels)
and enable
Auto resize images that are larger than max width or height
to
Yes: Everyone - Enabled for all users, including the Admin during batch-add process
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: Heroe on January 13, 2009, 01:06:37 pm
thank you i think i did what i want but i cant see big different in the watermark size
i change the options in:
 Files and thumbnails settings

and set the Max size for uploaded files (KB)                    1024 pixels
&
Max width or height for uploaded pictures/videos (pixels)   1024 pixels

and update from the admin tools now everything work  ;D

this is the result after the changes http://abroadbg.com/albums/userpics/10001/17/DSCN0785.JPG
(do you see the changes ?) Thank you very much again :)
I resised too many times the pictures,do you know if the mod change the quality of the pictures,because i think i read somewhere in the forum someore older version of the mod cut the quality and is fixed in the latest version of the watermark mod  ???

Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: Stramm on January 13, 2009, 01:17:54 pm
Lightbox dynamically resizes the image (as already said). If the watermark looks good in a 1024px width picture (displays in the desired size) and you size down this picture to 700px width, then of course the now permanent watermark looks smaller, too.

Find the size (width) of your images where the watermark should have it's 100% and that this as the reference.

Means viewing the images using your mod with a 800px width browser I get ~650px width images. If I use a 1024px width browser, images display at ~850+ px

The watermark is fix to a certain size.
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: locations on February 19, 2009, 12:19:33 am
I'm doing a site for a friend and did a fresh install of cpg1.4.20.
Overwrote the picmgmt.inc.php with the one from stramm_mod1.4.19.bridge.
Did the update.php.

Nothing shows in my Gallery Configuration.

Is this a 1.4.20 thing?

Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: Cath22 on February 19, 2009, 08:19:27 pm
Do we have to wait for a x.20 version or is the x.19 version also valid to use?

Thanks
Cath
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: locations on February 19, 2009, 11:29:54 pm
Disregard please.
I miss a ), in the code
It works perfectly


I'm doing a site for a friend and did a fresh install of cpg1.4.20.
Overwrote the picmgmt.inc.php with the one from stramm_mod1.4.19.bridge.
Did the update.php.

Nothing shows in my Gallery Configuration.

Is this a 1.4.20 thing?


Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: Stramm on February 20, 2009, 07:53:51 am
Do we have to wait for a x.20 version or is the x.19 version also valid to use?

Thanks
Cath

Similar questions have been answered many times within this thread. picmgmnt.inc.php doesn't change often. But you always can use the version from within the actual modpack.
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: jolly on May 05, 2009, 06:35:53 pm
I have all done well, but I can see any options in admin tool about watermark.
Where shoud be a path to set the location of watermark.png file ?

I from Poland , so I have edit a polish.php file instead english.php. But it does not matter, i guess.

Do I need to do all this changes again ?
What do you think, ?
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: Stramm on May 05, 2009, 06:52:13 pm
The options related to watermarking you can find in the 'config'.
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: jolly on May 05, 2009, 07:31:58 pm
what does it mean  " config" ??

you ment www.mycoppermine.com/admin.php settings ?
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: Stramm on May 05, 2009, 07:44:10 pm
Yes, please switch to english US so we use the same naming.
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: jolly on May 05, 2009, 08:48:21 pm
Strange, because I cannot change my default lanuguage. I choose english, click save settings, and I still got polish as a default. So I changed the name of file polish.php for a moment, and i got english menu now.

Ok, I see config, right, but there is absolutly nothing related to watermark. Why ?

I swap picmgtm.inc.php files, I made changes in all files, I have updated update.sql as well :/

?
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: Joachim Müller on May 05, 2009, 11:33:52 pm
what does it mean  " config" ??
RTFM!

you ment www.mycoppermine.com/admin.php settings ?
Post real links and not dummy placeholders!

Strange, because I cannot change my default lanuguage. I choose english, click save settings, and I still got polish as a default.
Nonsense. Go to http://www.mycoppermine.com/admin.php?lang=english then...
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: jolly on May 15, 2009, 02:30:41 pm
Ok, there is another little problem, for which i could not find solutions.

After uploads files by admin tools ( FTP) , the watermark is showed only in normal zise photos. When I click on the photography , the Large size is without watermark.

Updating files in admin tools does not help.

What i need to do to solve it ?
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: Stramm on May 15, 2009, 04:08:54 pm
I know this thread is long. But I answered this at least 10 times now  :-\

You'll need to chmod files (644 or 666) and folders (755 or 777). Seems your folder permissions are OK... So chmod your files. Best is to do that right after uploading (FTP).
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: mrdst on June 15, 2009, 09:12:04 am
Hello Stramm,

Doing this code for Free to all is a Great Thing. Thanks.

I am a newbie here and new to photo gallery management.

I did use your codes and successfully added the image watermarking in my config.
but I find some problem when I click on image watermarking on, then put some values, and then save new config and config save successfully but when I go back to the image watermarking i can see the values reset, everyhting is going back to default. So Im thinking its not functioning.
I did follow your procedures carefully and just copy and paste.

What do you think would be problem of this one? I missed something?

Please help me on this.

Thanks a lot.
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: Stramm on June 15, 2009, 12:32:15 pm
did you run update.php
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: mrdst on June 15, 2009, 01:08:47 pm
I just did running the update.php but still I can't see the watermarks.
I'm thinking maybe i didn't get what is really  "Which file to use for watermark " means. It's a complete url of the watermark.png or just a name of the image in the root directory?

Thanks for the prompt reply sir.
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: pcinfoman on July 09, 2009, 01:25:51 am
I see there is no reply. I added this mod as well. I get no error messages yet, I too do not see any watermark on my images.
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: Stramm on July 09, 2009, 07:02:36 pm
Read again how it works (first post of this thread)
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: mrdst on July 10, 2009, 04:47:23 am
I really didn't get it even I've tried doing it again,I've read the instruction more than twice and follow it religiously and  I don't see any errors about the codes so that means, I thought, the codes are correctly copied and pasted. But still I can't see my watermarks.

Here's what i did:
1. Copy and pasted all the codes included in this thread
2. replaced picmgmt.inc.php with the attached file.
3. and then run update.php
then in my config, the watermark option was added where I can put values.

Anyway,thank you very much. I just have zero knowledge about codes so that's why I didn't get it. maybe I need to learn those codes to make this work.

Great job to coders since there are lots who get it work.

mrdst



Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: Stramm on July 10, 2009, 09:21:26 am
from the first post
Quote
...If you want old images to get the watermark too, then you have to run the admin tools. To make it more comfortable for you I've added an 'auto refresh' feature.
When you're recreating thumbs/ images in the admin tools then you can set an auto refresh flag. If set, the update process auto refreshes and you won't need to click 'continue' anymore.
The big advantage.... you can set the number of images to process to a  low value eg (2-5). Now the chances the script times out are limited. Means you don't need to restart the entire process and sit in front of your monitor for hours clicking 'continue' (if you've a huge number of pics in your db)
You can turn auto refresh on/ and off on the admin tools page
Update thumbs and/or resized photos (1) - (checkbox) Auto refresh (no need to click continue button anymore)
I admit that is not easy to understand. More info about the admin tools you can find in the Coppermine docs.
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: mrdst on July 10, 2009, 10:02:31 am
Thanks a lot Stramm.
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: mrdst on July 29, 2009, 08:23:59 am
YES! I made it working now! Great! Thanks Stramm.
http://litrato.dstbox.com
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: mrdst on July 30, 2009, 05:18:03 am
Stramm's mod for the mod (http://forum.coppermine-gallery.net/index.php/topic,29817.msg143122.html#msg143122) is working great to my gallery http://litrato.dstbox.com (coppermine 1.4.19).
Thanks a lot for the excellent code.
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: bbm on August 04, 2009, 06:25:59 pm
Hi Stramm.. I got this working on a gallery with an older script, however, I had some problems with this on galleries running version 1.4.21 and 1.4.25 as well.

In 1.4.25 some lines were not found, and in the 1.4.21 version, I did manage to mod the code as per your posts #1 and #2 but the script only watermarks the intermediate pics, without resizing the watermark. I also edited the code for the script-resize, replaced the picmgmt.in.php and ran the update.php

Is this compatible with 1.4.25 ?
Thanks !!
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: doffer on October 02, 2009, 01:47:09 am
I really did read all the pages inside this mod. great mod ..

I have no one error after installed it but what ever I do it does not appear .. I mean no watermark, I mad a picture and saved it to the images directory but still no watermark.

I wonder.. is the    reason  the path to image and what can the absolute path be .. I tried   images/watermark.php , /public_html/images with or without /&\ before the public.
Also tried the tow long possibilities in the sec of third page I think.. one for windows and the other for nix.. just the same result.. no error or broken pica.. either no watermark

I use cpg1.4.25 and I like this great script

thanks in advance


Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: Joachim Müller on October 02, 2009, 08:31:47 am
Don't try paths, but know them. There are many great articles about paths that you really should read (google for them). However, we can't help you getting your paths right, as we can't see the path structure on your webserver, and you failed to do as suggested per board rules (http://forum.coppermine-gallery.net/index.php/topic,55415.msg270616.html#msg270616)...
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: doffer on October 02, 2009, 11:42:46 am
ok... you are right about the rules. I did not see it yet..

http://pv-almere.hostoi.com it is ok you can look at my gallery.

there are somethings not yet clear for me. I use version 1.4.25 do I have to use the attached picmgmt.inc.php instead off the standard one (backup then I try ). second is it not enough to use images/watermark.png.

I have a free account at http://www.000webhost.com (this is an unsolicited advert that triggered the stop-word filter) GD2 is installed

when the gallery is ready I will move it to a reall account... it is well now

thanks again

Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: bukavu on November 23, 2009, 01:46:35 pm


Setup:
just apply the following code, replace include/picmgmnt.inc.php with the attached file and run update.php

now have a look at your coppermine config. You'll need to modify the path to the watermark. Preset is a file watermark.png in the coppermine images folder. If that doesn't work for you, use the absolute path to the watermark image


Hello,

I am using Coppermine version: 1.4.18
My album is at http://www.bukavuonline.com/coppermine
I replaced include/picmgmnt.inc.php with the attached file and run update.php
and ran http://www.bukavuonline.com/coppermine/update.php , I saw some green OK

I uploaded my watermark image here http://bukavuonline.com/coppermine/images/watermark.png

As it didn't show in the album, I went to coppermine/config.php to see where i could edith the watermark full path but i cannot see it.

What else can I do please

Thank you

Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: Joachim Müller on November 23, 2009, 01:49:21 pm
I am using Coppermine version: 1.4.18
Then upgrade. We're not ready to discuss the need to keep your gallery up to date.
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: bukavu on November 23, 2009, 02:48:26 pm
Then upgrade. We're not ready to discuss the need to keep your gallery up to date.

I have smoothly upgraged to coppermine 1.4.25, took less than 5 minutes..
Thank you

Now my question is, is the watermark going to show on pictures which were already in albums or on news pictures only, because i still cannot see the watermark on my pictures
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin t
Post by: bukavu on November 23, 2009, 03:01:53 pm
you need to enable the watermark in config
you need check twice if you followed the instructions 100%
make sure albums folder and it's subfolders are chmod 777 or 755 (depending on your system) and the files at least 644

how do i enable the watermark in config please
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: Stramm on November 23, 2009, 05:57:04 pm
Quote
-lang/english.php

if you edited as suggested english.php then switch to english US to do the settings
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: bukavu on November 23, 2009, 06:52:16 pm
whenever i ste language to english, it goes back to gb_english

i also tried to chech the english.php file but couldn't see where to set the watermark link

using coppermine 1.4.25 on www.bukavuonline.com/coppermine

thanx
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: Stramm on November 23, 2009, 09:36:07 pm
Try http://www.bukavuonline.com/coppermine/?lang=english to switch to english. The config setting won't work as you think it does. Search the board for more info.
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: bukavu on November 23, 2009, 10:32:08 pm
I am having problems to find where to set watermarking in my config.php file

I attach it for you to see if possible help me set it please

Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: Stramm on November 24, 2009, 08:13:00 am
it's not in config.inc.php ... do as suggested, switch to english US and call the configuration by clicking 'Config' in the admin menu.
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: bukavu on November 24, 2009, 01:05:59 pm
it's not in config.inc.php ... do as suggested, switch to english US and call the configuration by clicking 'Config' in the admin menu.

I don't have english US, I only have english_gb and english

I followed the suggestion from the first post but I believe I am still missing out to understand somewhere
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: Stramm on November 24, 2009, 04:03:08 pm
english.php = english US
again: http://www.bukavuonline.com/coppermine/?lang=english
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: bukavu on December 08, 2009, 08:39:07 pm
english.php = english US
again: http://www.bukavuonline.com/coppermine/?lang=english

hello Stramm, can i give you my album admin details to check why is not working for me please..

i've done evrything as directed here but still cannot make it to work
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: Stramm on December 09, 2009, 06:55:54 am
you haven't uploaded all necessary modpack files correctly... please do that again as mentioned in the modpack announcemenmt thread
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: bukavu on December 09, 2009, 01:02:31 pm
you haven't uploaded all necessary modpack files correctly... please do that again as mentioned in the modpack announcemenmt thread

I have downloaded the picmgmt.inc.zip  which have got only one file inside picmgmt.inc.php

Where else can I download the module pack please
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: mybfolder on December 10, 2009, 02:05:56 pm
Hey Stramm,
First of all I would like to thank your for your effort, great work you're doing here!

I have a small problem though:
1) I edited all the files as stated in your first three posts.
2) I then replaced the one particular file from your first post with the old file.
3) I uploaded all those files after I made a backup.
4) I set CHMOD to 777/666.
5) I tried to run update.php but got the error config.inc.php was missing.
6) I made a new config.inc.php with user/pw to my db etc. after I discovered I had a config.inc.php.sample laying around somewhere.
7) I ran update.php again and it worked.
8) Now everything is working (watermarking shows up in config, not tested yet though) EXCEPT all my pictures are gone. They are not really gone but nobody can see them.

See for yourself:
http://mybfolder.org

If you need a testacc. please let me know, I figured you maybe don't so I didn't made one (yet).
The weird thing is, that everything works perfectly (top rated, most views, users etc.) just the images can't be displayed.
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: Phill Luckhurst on December 10, 2009, 04:05:58 pm
You are running version <!--Coppermine Photo Gallery 1.4.19 (stable)--> while the current version is 1.4.25. You will need to upgrade before we can help you.
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: mybfolder on December 10, 2009, 04:38:50 pm
Maybe I shouldn't overwrite /albums/  ::)
Everything is working again (and I even upgraded), thanks for the quick response anyway!
Title: Re: Permanant watermark with undo possibility (GD2+IMagick) + better admin tools
Post by: travelbuff on January 09, 2010, 09:25:26 pm
Sorry I cannot find out which files these are to edit as part of the watermark Mod?
Thanks

-delete.php
find
Code: [Select]
function output_table_header()
{
    global $header_printed, $need_caption, $lang_delete_php;

    $header_printed = true;
    $need_caption = true;

echo <<<EOT
<tr>
<td class="tableh2"><b>{$lang_delete_php['npic']}</b></td>
<td class="tableh2" align="center"><b>{$lang_delete_php['fs_pic']}</b></td>
<td class="tableh2" align="center"><b>{$lang_delete_php['ns_pic']}</b></td>
<td class="tableh2" align="center"><b>{$lang_delete_php['thumb_pic']}</b></td>
<td class="tableh2" align="center"><b>{$lang_delete_php['comment']}</b></td>
<td class="tableh2" align="center"><b>{$lang_delete_php['im_in_alb']}</b></td>
</tr>
EOT;
}

function output_caption()
{
    global $lang_delete_php
    ?>
<tr><td colspan="6" class="tableb">&nbsp;</td></tr>
<tr><td colspan="6" class="tableh2"><b><?php echo $lang_delete_php['caption'?></b></tr>
<tr><td colspan="6" class="tableb">
<table cellpadding="1" cellspacing="0">
<tr><td><b>F</b></td><td>:</td><td><?php echo $lang_delete_php['fs_pic'?></td><td width="20">&nbsp;</td><td><img src="images/green.gif" border="0" width="12" height="12" align="absmiddle"></td><td>:</td><td><?php echo $lang_delete_php['del_success'?></td></tr>
<tr><td><b>N</b></td><td>:</td><td><?php echo $lang_delete_php['ns_pic'?></td><td width="20">&nbsp</td><td><img src="images/red.gif" border="0" width="12" height="12" align="absmiddle"></td><td>:</td><td><?php echo $lang_delete_php['err_del'?></td></tr>
<tr><td><b>T</b></td><td>:</td><td><?php echo $lang_delete_php['thumb_pic'?></td></tr>
<tr><td><b>C</b></td><td>:</td><td><?php echo $lang_delete_php['comment'?></td></tr>
<tr><td><b>D</b></td><td>:</td><td><?php echo $lang_delete_php['im_in_alb'?></td></tr>
</table>
</td>
</tr>
<?php
}
and replace with
Code: [Select]
function output_table_header()
{
    global $header_printed, $need_caption, $lang_delete_php;

    $header_printed = true;
    $need_caption = true;

echo <<<EOT
<tr>
<td class="tableh2"><b>{$lang_delete_php['npic']}</b></td>
<td class="tableh2" align="center"><b>{$lang_delete_php['fs_pic']}</b></td>
<td class="tableh2" align="center"><b>{$lang_delete_php['ns_pic']}</b></td>
<td class="tableh2" align="center"><b>{$lang_delete_php['orig_pic']}</b></td>
<td class="tableh2" align="center"><b>{$lang_delete_php['thumb_pic']}</b></td>
<td class="tableh2" align="center"><b>{$lang_delete_php['comment']}</b></td>
<td class="tableh2" align="center"><b>{$lang_delete_php['im_in_alb']}</b></td>
</tr>
EOT;
}


function output_caption()
{
    global $lang_delete_php
    ?>
<tr><td colspan="7" class="tableb">&nbsp;</td></tr>
<tr><td colspan="7" class="tableh2"><b><?php echo $lang_delete_php['caption'?></b></tr>
<tr><td colspan="7" class="tableb">
<table cellpadding="1" cellspacing="0">
<tr><td><b>F</b></td><td>:</td><td><?php echo $lang_delete_php['fs_pic'?></td><td width="20">&nbsp;</td><td><img src="images/green.gif" border="0" width="12" height="12" align="absmiddle"></td><td>:</td><td><?php echo $lang_delete_php['del_success'?></td></tr>
<tr><td><b>N</b></td><td>:</td><td><?php echo $lang_delete_php['ns_pic'?></td><td width="20">&nbsp</td><td><img src="images/red.gif" border="0" width="12" height="12" align="absmiddle"></td><td>:</td><td><?php echo $lang_delete_php['err_del'?></td></tr>
<tr><td><b>O</b></td><td>:</td><td><?php echo $lang_delete_php['orig_pic'?></td></tr>
<tr><td><b>T</b></td><td>:</td><td><?php echo $lang_delete_php['thumb_pic'?></td></tr>
<tr><td><b>C</b></td><td>:</td><td><?php echo $lang_delete_php['comment'?></td></tr>
<tr><td><b>D</b></td><td>:</td><td><?php echo $lang_delete_php['im_in_alb'?></td></tr>
</table>
</td>
</tr>
<?php
}

find
Code: [Select]
    $files = array($dir . $file, $dir . $CONFIG['normal_pfx'] . $file, $dir . $CONFIG['thumb_pfx'] . $file);
replace with
Code: [Select]
    $files = array($dir . $file, $dir . $CONFIG['normal_pfx'] . $file, $dir . $CONFIG['orig_pfx'] . $file, $dir . $CONFIG['thumb_pfx'] . $file);


find
Code: [Select]
        starttable("100%", $lang_delete_php['del_pic'], 6);
        output_table_header();
        $aid = delete_picture($pid);
        output_caption();
        echo "<tr><td colspan=\"6\" class=\"tablef\" align=\"center\">\n";
replace with
Code: [Select]
        starttable("100%", $lang_delete_php['del_pic'], 7);
        output_table_header();
        $aid = delete_picture($pid);
        output_caption();
        echo "<tr><td colspan=\"7\" class=\"tablef\" align=\"center\">\n";


editpics.php
find
Code: [Select]
                        $files=array($dir.$file, $dir.$CONFIG['normal_pfx'].$file, $dir.$CONFIG['thumb_pfx'].$file);
replace with
Code: [Select]
                        $files=array($dir.$file, $dir.$CONFIG['normal_pfx'].$file, $dir.$CONFIG['thumb_pfx'].$file, $dir.$CONFIG['orig_pfx'].$file);

searchnew.php
find
Code: [Select]
            if (strncmp($file, $CONFIG['thumb_pfx'], strlen($CONFIG['thumb_pfx'])) != 0 && strncmp($file, $CONFIG['normal_pfx'], strlen($CONFIG['normal_pfx'])) != 0 && $file != 'index.html') {
replace with
Code: [Select]
            if (strncmp($file, $CONFIG['orig_pfx'], strlen($CONFIG['orig_pfx'])) != 0 && strncmp($file, $CONFIG['thumb_pfx'], strlen($CONFIG['thumb_pfx'])) != 0 && strncmp($file, $CONFIG['normal_pfx'], strlen($CONFIG['normal_pfx'])) != 0 && $file != 'index.html') {

                  
                                    
now just replace include/picmgmnt.inc.php with the attached one

if you want to have the 'automatically downsize watermark on small images' functionality go here http://forum.coppermine-gallery.net/index.php?topic=29817.msg143122#msg143122
(just a minute of extra work and well worth it ;) )
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: Stramm on January 10, 2010, 09:51:30 am
First line you quoted:
Quote
-delete.php
find

Further down one can read:
Quote
editpics.php
find
and
Quote
searchnew.php
find

What was the question?
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: travelbuff on January 10, 2010, 04:13:41 pm
Stramm
I'm sorry again, I didn't realize the first file was actually named delete.  I have done all of the code changes, changed the .zip file to the new one and ran update.php but I do not show any watermark settings in the config section.
When I run update.php I have some files that show a green OK on the right and all of the rest show already done.  Is this correct?
I'm really trying to get this to work.
Thanks
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: Stramm on January 10, 2010, 04:56:50 pm
That's as it should be. Make sure you switch to the language that you've edited (e.g. english.php -> English US). For that use the language dropdown selector.
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: travelbuff on January 11, 2010, 03:06:33 am
Stramm
Ok I removed my coppermine file, reloaded it and updated to the latest version, went slowly through you whole mod and the photo shop. I now see the image watermark in the config.  I added your sample watermark image and I have it set to work on both images but I don't see anything over the photo.  Is there something else I'm missing or a piece of code I can double check.  I went through it twice already.

Thanks
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: Stramm on January 11, 2010, 05:55:42 pm
... If you want old images to get the watermark too, then you have to run the admin tools. To make it more comfortable for you I've added an 'auto refresh' feature.
When you're recreating thumbs/ images in the admin tools then you can set an auto refresh flag. If set, the update process auto refreshes and you won't need to click 'continue' anymore.
The big advantage.... you can set the number of images to process to a  low value eg (2-5). Now the chances the script times out are limited. Means you don't need to restart the entire process and sit in front of your monitor for hours clicking 'continue' (if you've a huge number of pics in your db)
You can turn auto refresh on/ and off on the admin tools page
Update thumbs and/or resized photos (1) - (checkbox) Auto refresh (no need to click continue button anymore)
...



Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: travelbuff on January 13, 2010, 02:38:44 am
Well, I tried that also but still no watermark over the image.  I started with a empty photo gallery so I only have one image in there. I wanted to make sure it worked first.  Anything else I can try?

 ???
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: Joachim Müller on January 13, 2010, 08:52:38 am
Posting the details might help, e.g. a link to your gallery and a deep link to your watermarking image.
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: Stramm on January 13, 2010, 09:47:31 am
http upload a file... once that works take care of existing ones (read this thread, look out for chmod and permissions).

If http won't work, check if the path to the watermark file is correct.
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: travelbuff on January 14, 2010, 01:38:39 am
http://mobileimagery.com/coppermine/index.php is the link to the gallery and the deep image link is http://mobileimagery.com/coppermine/images/watermark.png.

The watermark link is exactly the way its described in the directions.
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: Stramm on January 14, 2010, 06:06:50 pm
then do as I told you yesterday

Quote
http upload a file...
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: travelbuff on January 15, 2010, 12:11:35 am
I guess I didn't explain enough.  I have a brand new gallery with one picture in it.  I uploaded that photo just fine. All of that part is working. I'm trying to get the watermark to show on the single image I have in the gallery before I upload any more.
Sorry for any confusion.
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: travelbuff on January 15, 2010, 01:30:01 am
Stramm
I deleted the only image I had, reloaded a new image and presto, the watermark was there.  Sorry for any confusion.
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: Stramm on January 15, 2010, 07:46:18 am
as said, once watermarking works for http uploads go for the existing images (read the mods docs on how to do that, keep permissions in mind)
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: Joachim Müller on February 02, 2010, 01:14:42 pm
Just for the record: tools recommended to batch-watermark images on your client before upload:Both tools are free
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: kylemj on March 21, 2010, 09:51:31 pm
i cant find anything in delete.php
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: Stramm on March 21, 2010, 09:57:46 pm
i cant find anything in delete.php

what do you want to tell me with that?
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: kazakov on April 05, 2010, 11:29:51 am
Hello Stramm,Firstly,thank you very much for this great mods.

I've nothing wrong by using your step,but when I create an album --click "Apply Modifications",the page show

Code: [Select]
Fatal error: Cannot redeclare output_caption() (previously declared in /home/russiavo/public_html/gallery/delete.php:55) in /home/russiavo/public_html/gallery/delete.php  on line 91
It should be something wrong in delete.php,but I don't understand what it is....
Would you mind to explain the error?

Thank you very much!
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: kazakov on April 05, 2010, 11:39:01 am
Sorry!I re-read the delete.php and found out the problem!!Now,I am trying to test the watermark,and see if its work!!

Thanks for the great mods!!!
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: kazakov on April 05, 2010, 12:07:08 pm
Sorry!I re-read the delete.php and found out the problem!!Now,I am trying to test the watermark,and see if its work!!

Thanks for the great mods!!!

It is me again!
http://www.russiavolley.com/gallery/displayimage.php?album=random&cat=0&pos=-2

watermark is okay,no error.
But a little problem show,the watermark on resized picture is quite big and the largest photo is too large which show a very small watermark.
Where I can fix this problem?

I've already edit the second mods in page 2.

Thanks in advice!!
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: Joachim Müller on April 05, 2010, 12:15:09 pm
Well, then don't use the sample watermark (see attached hardcopy), but a watermark you chose (i.e. one that you create). Don't expect to be spoon-fed. And while you're at it, enter the URL of your gallery into the corresponding field of your config panel.
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: kazakov on April 05, 2010, 01:17:18 pm
Well, then don't use the sample watermark (see attached hardcopy), but a watermark you chose (i.e. one that you create). Don't expect to be spoon-fed. And while you're at it, enter the URL of your gallery into the corresponding field of your config panel.


Thanks for your kind reply.
I can try to do it by myself.Just would like to know where is the problem to make the watermark like this

Your meaning is,I use my own watermark,and the problem will be fix?
I tried to change the number in "File and Thumbnails settings"
but the large photo of the watermark is too small.

Thanks!
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: Stramm on April 06, 2010, 08:27:21 pm
try watermark downsizing
http://forum.coppermine-gallery.net/index.php/topic,29817.msg143122.html#msg143122
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: Blayde on May 07, 2010, 12:42:31 pm
First, I wanted to thank you for the mod. I've never modded CM in my life
and got it right on the first try (a record!). Great, great stuff, Stramm.  ;D

Now, my small question. I added the downsizing mod after the WM mod.
It's not taking, but I think it's because of my configuration. So my Q is
what do you suggest I put in this area:

Downsize watermark if width of an picture is smaller than entered value.
That is the 100% reference point. Resizing of the watermark is linear (0 to disable)


I have no idea what I should enter there, but my WM image size is: 600x569
(because most of my images are huge)

Many thanks!
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: Blayde on May 07, 2010, 05:55:00 pm
>.< I couldn't edit...

Thanks, but I figured it out. I'm having an issue with some of the medium-size images not
watermarking (images that were there prior), but overall, it's working -and nicely.

Thanks again!
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: pawelfoto on July 12, 2010, 08:05:00 pm
HI,

I am trying and trying to undo the watermark. I dont need it any more, and I want "clean" pics again.
I have tured off watermark image, and did Update thumbs and/or resized photos in admin settings. It didnt work, and now I have watermark even on my thumbnails !!

Please, tell me, how to remove watermarks from my all photos ?

www.pawelfoto.com
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: Stramm on July 12, 2010, 08:45:10 pm
That's the way to undo the watermark. The mod doesn't apply watermarks to thumbs so that's somewhat odd.
However I can't see watermarks on any of your images...
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: pawelfoto on August 11, 2010, 07:55:21 am
Allrigt it's ok now, my mistake.
I have one more question:

Can I have two watermarks on each new photo? Let's say left up corner, and right down... Hard to code?
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: Stramm on August 11, 2010, 09:36:18 am
Not that difficult to code if you know how to do it. 1-2 hours if you don't make it a config option but hardcode it.
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: bibendum on September 15, 2010, 01:14:05 am
Hi
Thanks you for this mod, all are ok but i have problem with the file : searchnew.php

If i'm editing this file like requiered, i can't see new file in folder i uploaded with ftp.

Without editing searchnew.php, all are working perfectly, even with uploaded ftp files, watermak is on all files.

What's wrong ?

Thanks


Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: Stramm on September 15, 2010, 08:15:41 am
Post links, properly chmod files and folders
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: bibendum on September 15, 2010, 10:10:41 pm
Hi
Files and folders are chmoded well i suppose.
What chmod must i apply to searchnew.php ?
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: Stramm on September 15, 2010, 10:33:59 pm
with files and folders I mean the images and the containing folders and please do as I suggested
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: bibendum on September 15, 2010, 10:38:31 pm
Hi
The searchnew.php are chmoded well.
If i apply modification, i can't see new files i uploaded with ftp.
Without modification, i can see new files and watermak is working well on theses files.
So why must i modify searchnew.php ?
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: Stramm on September 15, 2010, 10:41:51 pm
I never said you should do anything to searchnew.php. I told you to post links!
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: bibendum on September 15, 2010, 10:43:39 pm
Links of what ?
To see something you must be admin.
In the first page of this topics, searchnew.php must be modified. 
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: johnsport on December 28, 2014, 08:03:14 pm
Hi

happy new year for all

I have many sports images

Obtained from sports sites

And I want to remove the watermark them

Without the use of Photoshop or any other software

I want to be removed by a hacker without affecting the image  :-\

It is of you can help me and will give him the money if he can be removed  ;)
Title: Re: Permanant watermark with undo possibility (GD2+IM working!) + better admin tools
Post by: parfum on November 22, 2016, 06:46:45 am
I really did read all the pages inside this mod. great mod ..

I have no one error after installed it..faced some problems but fixed them already by follwing the suggestions here.
thanks again