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
-
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
-
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
#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
if (defined('ADMIN_PHP')) $lang_admin_php = array(
below add
'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
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
'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
'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
'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
'fs_pic' => 'full size image',
below add
'orig_pic' => 'original image',
-admin.php
find
function create_form(&$data)
above add
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
case 17 :
form_asc_desc($element[0], $element[1], $element[3]);
break;
below add
//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
$defpicnum = 45;
and replace with
$defpicnum = 5;
find
<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
<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
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
'del_orphans' => array('del_orphans', $lang_util_php['delete_orphans'], $lang_util_php['delete_orphans_explanation']),
below add
'deletbackup_img' => array('deletbackup_img', $lang_util_php['delete_back'], $lang_util_php['delete_back_explanation']),
-
-delete.php
find
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"> </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"> </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"> </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
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"> </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"> </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"> </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
$files = array($dir . $file, $dir . $CONFIG['normal_pfx'] . $file, $dir . $CONFIG['thumb_pfx'] . $file);
replace with
$files = array($dir . $file, $dir . $CONFIG['normal_pfx'] . $file, $dir . $CONFIG['orig_pfx'] . $file, $dir . $CONFIG['thumb_pfx'] . $file);
find
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
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
$files=array($dir.$file, $dir.$CONFIG['normal_pfx'].$file, $dir.$CONFIG['thumb_pfx'].$file);
replace with
$files=array($dir.$file, $dir.$CONFIG['normal_pfx'].$file, $dir.$CONFIG['thumb_pfx'].$file, $dir.$CONFIG['orig_pfx'].$file);
searchnew.php
find
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
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 ;) )
-
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)
-
it's 'built in' in the above hack
-
it's 'built in' in the above hack
::) I guess I should have read your post completely before asking... :-X
thanks
-
Great job on this mod Stramm. :)
Working very good on my site.
Thank You
-
I received the following error...redid the hack to this file, and the error still occurs....
Parse error: syntax error, unexpected '}' in /home/gallery/searchnew.php on line 264
your replacement code needs to include the final '{' in that line...
-
yes, I've added the starting bracket '{' now, thanks
-
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!!
-
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
-
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.
-
you replaced the picmgmnt.inc.php with the attached one?
-
:'(
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.
-
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
-
666 ALL copermine files? And 777 ALL Coppermine folders?
-
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
-
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?
-
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
-
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
-
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
-
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
-
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?
-
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
-
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
INSERT INTO CPG_config (name, value) values ('reduce_watermark', '0');
lang/english.php
find
array('Transparency 0-100 for entire image', 'watermark_transparency', 0),
below add
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
-
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.
-
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
-
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
-
for this mod... read here http://forum.coppermine-gallery.net/index.php?topic=29817.msg137993#msg137993
-
Hey,
Awesome mod! ;D
However, there is no "sql/sql.inc" . lol
Thanks a lot,
Will
-
Thanks ;)
but where do I talk about sql.inc?? Maybe you mean update.sql
-
Hey,
And I quote:
sql/sql.inc
at the end of this file add
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
-
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
-
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
-
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)
-
It works great on v1.4.6
thnx man!
-
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??
-
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)
-
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
-
Ok resolved, language problem ;)
-
(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?
-
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
-
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!
-
How can I watermark the pictures which are already on the site automatically ?
-
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
-
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
-
Sorry for my inconvenience - I've reading the explanation
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!
-
OK, perfect...
-
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 ;)
-
you can hardcode that into picmgmnt.inc.php
if you use ImageMagick it's geometry widthxheight
if you use GD2 you look for
$pos = $CONFIG['where_put_watermark'];
if ($pos == "northwest") {
and below you change all '5' to the offset you'd prefer
-
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
-
probably you haven't run update.php as mentioned in the first post
-
probably you haven't run update.php as mentioned in the first post
I have run it, it just doesnt save
Dan
-
if it doesn't save you have made a mistake applying the mod. Usually the sql is missing
-
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?
-
No worries, Sorted it
-
what did you do? Maybe others can profit from your experience too
-
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.
-
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
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
-
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?
-
Setup:
just apply the following code, replace include/picmgmnt.inc.php with the attached file and run update.php
-
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.
-
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 )
-
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?
-
Please read this thread
-
got it:
http://forum.coppermine-gallery.net/index.php?topic=29817.msg152455#msg152455
thanks.
-
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
-
the last guy who posted in here had the same problem ::)
-
yes, but the link reported don't resolve the problem (i'd the update but only the intermediates change)
-
ok.. the permission is to be set on 666 and not on 644... :D
-
I've searched this entire post. Where is the attached file picmgmnt.inc.php
Could someone please point me in the right direction?
-
cancel that. once i logged in it showed up.
-
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
-
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
-
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):
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.
-
Hi everyone.
- possibility to assign different watermarks to certain users.
Is this also possible for this mod? (1.4.x)
-
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
-
Hi everyone.
Is this also possible for this mod? (1.4.x)
would be possible if you code the necessary changes
-
would be possible if you code the necessary changes
:-\ What are the changes I have to make?
-
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
-
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
-
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... ???
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;
}
-
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
-
@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.
-
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.
-
@stramm
yes :D found the replacement after some minutes. Changed it
} else { // shrink not enabled or no intermediate...
$logoImage = ImageCreateFromPNG($CONFIG['watermark_file']);
to
} else { // shrink not enabled or no intermediate...
$logoImage = ImageCreateFromPNG($wm_file);
Now it works for me (1.4.9) thx ;D
-
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:
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:
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
-
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
-
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.... :-\
-
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
-
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
-
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.
-
I've attached a sample... width 400px so you can use it with the downsize feature
edit: layer transparency = 50%
-
Thanks Stramm! It is really appreciated! ;)
Claude
-
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
-
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
@ini_set('memory_limit', '32M');
after
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
-
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
-
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
-
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.
-
now just replace include/picmgmnt.inc.php with the attached one
Where is that ? ???
-
Attached to the very first posting. Read more carefully!
-
I'm sorry :D
Is there a mod to watermark the already uploaded images?
-
Read the first post more carefully!
-
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.
-
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 if (!file_exists($thumb)) {
you need add an if-else clause and when watermarking is turned on in config ->
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 $wm_resize = (int)(($destWidth / $wm_normal) * 100);
here you hardcode something like...
if($wm_resize < 100) $wm_resize = 100;
not tested but it should work
-
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
-
http://forum.coppermine-gallery.net/index.php?topic=29817.msg142838#msg142838
-
ive seen no atached file for 1.4.9 is it the same with the 1.4.8 one ?
-
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
-
i have do all things you said.
but i get this errors:
/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???
-
link+testuser account please, make sure that user's allowed to upload pics
-
ok.
now it works.
i dont know why but it works.
thank you for the hack..... :) :) :) :)
-
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
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
-
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?
-
no, you'll have to apply the changes manually
-
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)
-
good mod.... thanks alot...
i wish the next version of gallery can have it build-in too...
thanks :)
-
already done
-
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! ;)
-
Read the first post in this thread again, especially the part with the setup instructions
Setup:
just apply the following code, replace include/picmgmnt.inc.php with the attached file and run update.php
-
Read the first post in this thread again, especially the part with the setup instructions
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.
-
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
-
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
replace include/picmgmnt.inc.php with the attached file
this 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)
-
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 ???
-
batch add: make sure you've properly modified searchnew.php (the last step to do)
-
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.
-
1.5
-
@Stramm: Yep, I edited the files correct (i hope so). The Mod did already work, so that's what's strange for me ???
-
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)
-
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
-
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
-
Thanks, Stramm! The files had permission 777, after I changed it to 666 it worked :o
;)
-
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
-
that's a job for your host to do (php.ini)
-
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!
-
don't set any value for 'Set color transparent x,y'
-
I didn`t. that value it 0.
Should I install the MOD again? Can it be an instalation error?
Thanks for the reply!
-
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
imagecolortransparent($logoImage, imagecolorat($logoImage, $CONFIG['watermark_transparency_featherx'], $CONFIG['watermark_transparency_feathery']));
replace with
//imagecolortransparent($logoImage, imagecolorat($logoImage, $CONFIG['watermark_transparency_featherx'], $CONFIG['watermark_transparency_feathery']));
-
and... use a png as watermark image (as stated in the docs - first post in this thread)
-
ok! i`ve done it and it works now! thanks for helping me! keep up the good work!
-
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 :)
-
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
-
alright thanks :), i'll try to look through it but i think i can live with them so. thanks again for a great mod!
-
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.)
-
will do!, thanks :)
-
Works great with 1.4.9. Thanks a lot ;D
-
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.
-
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.
-
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.
-
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
-
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.
-
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)
-
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.
-
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.
-
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.
-
and you may wish to use the picmgmnt.inc.php from the modpack either way
-
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!
-
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?
-
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
-
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
-
It also might be an invalid watermark image or the wrong path to it
and you may wish to use the picmgmnt.inc.php from the modpack either way
-
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 ?
-
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
-
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?
-
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
-
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.
-
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!
-
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.
-
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
-
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)
-
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
-
I missed all the other mods to other files. I have done all those but still cannot see the watermark !!
Pete
-
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.
-
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.
-
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:
Parse error: parse error, unexpected T_DOUBLE_ARROW in /home/fhlinux182/h/helendallimore.diva-host.com/user/htdocs/gallery/util.php on line 500
-
review all changes you have done. Somewhere's a typo etc
-
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
-
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
-
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
-
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
-
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
-
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;
}
}
-
i solved all problems 8)
and the mod is very very very very gooooood
and you stramm is very very very goooood ;D ;D
-
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?
-
Nevermind... just found it attached to the first post, instead of the one it is mentioned in.
-
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
-
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.
-
could you please tell me where to download the latest version of this?
thanks.
-
see sig
-
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. ???
-
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.
-
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.
-
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.
-
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.
-
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 :
Here's a version that works with PHP 5.x - I use this to watermark images on a shared server.
-
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).
-
[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]
-
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.
<?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($ftpConn, 0666, $ftpFilename) ? "CHMOD successful!" : 'Error';
// do what you need here
//Now change permissions back to 644 or whatever
echo ftp_chmod($ftpConn, 0644, $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!
-
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.
-
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:
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:
... 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
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:
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.
-
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.
-
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.
-
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?
-
Have you carefully read the first post of this thread? And is there a reason for the code mess you posted?
-
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:
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
-
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.
-
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?
-
Every image editing should be able to do that (layer transparency). Photoshop, Gimp, Corel Paint ...
-
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
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 :-[
-
have you read my posting??
... 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).
-
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.
-
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§ion=0&type=2
-
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.
-
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
-
I PMed you with all the necessary info.
-
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.
-
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...
-
We're talking here about the backup images?? Don't we
-
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 :)
-
Hello,
How can I add the username on the picture and the watermark ?
Thanks
PS : Sorry for my poor English, I'm French....
-
That's not a feature of this mod. You'll have to code it.
-
ok thank you ;)
-
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
-
Setup:
just apply the following code, replace include/picmgmnt.inc.php with the attached file and run update.php
-
Thanks! Took me some time to figure out what actually means to run updat.php but i did it. It works perfect now :D
-
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?
-
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.
-
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 ->
-
---------------
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>
-------------------------
-
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
-
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
-
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
-
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?
-
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)
-
Are you sure we are talking about the same problem?
-
yes, ask on the modpack board...
-
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?
-
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)
-
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.
-
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
-
Thank you.
Apologies for posting in the wrong thread.
-
Hi
Can i apply this wonderfull mod to cpg 1.4.14 ?
Thanks
-
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..
= 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)
-
reupload picmgmnt.inc.php. Make sure you overwrite the original... or rename the original file to something else and then upload
-
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
-
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
-
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?
-
don't be so lazy and read the first post of this thread
-
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.
-
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
-
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.
-
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.
-
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
$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)
-
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=bd748ff6cb03f5a2948691cbef89e992b873cdcc) (http://www.bikers-n-outlaws.com/cpg/)
-
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)
-
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)
-
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?
$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 } ?>
-
reupload picmgmnt.inc.php
-
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.
-
should work... but better use the up to date one from the modpack
http://forum.coppermine-gallery.net/index.php?topic=28367.0
-
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
-
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
-
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
-
from the first post
Setup:
just apply the following code, replace include/picmgmnt.inc.php with the attached file and run update.php
-
from the first post
sorry,i'm a newb
what you mean by run update.php?
-
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
-
rosner, just run http://youdomain/gallery/update.php
-
rosner, just run http://youdomain/gallery/update.php
Thank you!
I done it!!!
-
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!
-
Has been asked and answered at least 10 times before. Last time just a few posts above
-
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!
-
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
-
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.
-
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
-
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.
-
Stramm
Thanks mate for clearing that up. I shall apply the upgrade when i get a chance.
Cheers
Pete
-
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?
-
should work without problems...
post a link and a login with upload permissions. Also tell me your settings so I can test it.
-
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
-
as mentioned in the first post you need to run update.php
Setup:
just apply the following code, replace include/picmgmnt.inc.php with the attached file and run update.php
-
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.
-
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.
-
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.
-
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)
#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]
-
check on the server if it's uploaded correctly
-
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)
-
Is this mod goiing to be updated to CFG 1.4.16? There has been some updates in `picmgmt.inc.php`.
-
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
-
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.
-
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
<Files orig_*>
Order deny,allow
Deny from all
Allow from localhost
</Files>
-
^ OMG! Thanks so much it worked like a charm! :D
-
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?
-
Just read the very first post of this thread carefully...
-
Can i use the file's mod for 1.4.16 version?
-
http://forum.coppermine-gallery.net/index.php/topic,29817.msg245065.html#msg245065
-
Thank you for this MOD. Works great!
-
i get the foll error while running the sql:
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..
-
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
-
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:
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..
-
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
-
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..
-
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
-
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
-
Have you switched language to english US to do the settings? Or to thzat language file you've edited?
-
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
-
use the dropdown selector to make sure you selected english US
-
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
-
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
-
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.
-
hmm... better read more about selecting the language in the docs http://coppermine-gallery.net/demo/cpg14x/docs/index.htm#admin_language
-
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
-
please refer to this link: http://forum.coppermine-gallery.net/index.php/topic,51971.msg252292.html#msg252292
Regards,
Steff
-
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]
-
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
-
http://forum.coppermine-gallery.net/index.php/topic,50450.msg242984.html#msg242984
thanks.
-
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
-
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
-
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.
-
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
-
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
-
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
-
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.
-
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
-
true... but as said, the last page...
-
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
-
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.
-
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
-
I have posted in several threads already my recommendation for local watermarking:
- Locking Photographs (http://forum.coppermine-gallery.net/index.php/topic,43958.0.html)
- Watermark (http://forum.coppermine-gallery.net/index.php/topic,33993.0.html)
- looking for watermark tool to watermark (http://forum.coppermine-gallery.net/index.php/topic,22238.0.html)
- How do you resize your pictures? (http://forum.coppermine-gallery.net/index.php/topic,12246.0.html)
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
-
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?
-
Read this thread, especially the last two pages
-
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?
-
It's in the first post of this thread ;)
To undo watermarks just disable watermarking in config and run the admin tools.
-
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..;)
-
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..;)
-
sorry, pls delete my 1st post... it's all wrong.. :-[
-
It ends right before the next function declaration (function del_orig()). Also the indentation should be able to help you.
-
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...
-
buddies don't get bridged... there are independent smf and cpg buddies (if you use the modpack)
-
buddies don't get bridged... there are independent smf and cpg buddies (if you use the modpack)
o.i.c... thkx 4 the info
-
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?
-
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.
-
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!
-
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?
-
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.
-
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'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!
-
hmm isnt watermarking on the larger image when using the batch add files function
-
Look for the solution within this therad. Has been asked and answered several times
-
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
-
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!!!!!!!!!!!!
-
you'll have to modify picmgmnt.inc.php
delete
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??
-
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
-
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.
-
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
-
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 :(
-
then you probably made a mistake... try applying the changes again
-
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..
-
Carefully read the first post again... this is not an 'on the fly watermarking mod' but a 'permanent' one.
-
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
-
usually the reason is not enough php memory (memory_limit in php.ini)
-
hmmm I don't think I can change that on my free hosting account, can I?
-
or skip the ones that have a watermark already?
idk...
-
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
-
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
-
Make sure you did the modifications exactly as described.
-
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.
-
You need to run update.php for the database changes to take effect. I think that's missing from the instructions.
-
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 :)
-
upgrade to 1.4.19, then post a link to your site and all your watermarking settings
-
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!
-
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
-
Check the permissions on the files. They need to be writeable for admin tools to update them.
-
Sorry but how do I do that? :-[
-
OK cancel that. I understood later what permissions you're talking about. My bad.
-
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.
-
got a fresh util.php file..thanks
-
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
-
Make sure you followed the instructions to the point.
Make sure your php settings are sufficient to do resizing, watermarking (memory limit)
-
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.
-
size of the pic you're trying to resize and/ or watermark (width, height)
-
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.
-
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.
-
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.
-
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?
-
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
-
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.
-
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
-
scratch it..got it working..had an error with the image file.
thanks!
-
Hi
Work perfectly on 1.4, thanks for this work.
-
grrr...nvm, it's throwing off the error again...I posted the php info for my server.
-
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
-
Have you read what I've written above??
Then post results!
-
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?
-
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:
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
-
Stramm..is there anything else I can do to help you troubleshoot this issue?
I really am wanting to use this watermark mod!
Thanks...
-
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)
-
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)
-
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...
-
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
-
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.
-
Great mod!!
Is ther anyway to have the watermark show for some groups and not for others?
-
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?
-
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.
-
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
-
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.
-
Read this thread, it has to do with permissions and has been asked and answered lots of times.
-
I still can't get the mod to work properly on my gallery...I'll probably just install it.
-
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
-
Nothing brisge related is used for this mod... just try it.
-
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
-
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
-
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
-
please zip and attach util.php to your next post
-
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.
-
Works like a charm. Thanks for the good work :)
-
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):
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!
-
i got this error :/
Parse error: syntax error, unexpected T_FUNCTION, expecting '{' in /home/ohbelanova/domains/ohbelanova.com/public_html/galeria/admin.php on line 704
-
recheck the modifications you did within admin.php
-
when i add this code to admin.php it gives me the error
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?
-
zip your modded admin.php and attach it to your next post
-
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
-
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 :)
-
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?])
-
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 :)
-
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
-
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 ???
-
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.
-
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?
-
Do we have to wait for a x.20 version or is the x.19 version also valid to use?
Thanks
Cath
-
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?
-
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.
-
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, ?
-
The options related to watermarking you can find in the 'config'.
-
what does it mean " config" ??
you ment www.mycoppermine.com/admin.php settings ?
-
Yes, please switch to english US so we use the same naming.
-
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 :/
?
-
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...
-
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 ?
-
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).
-
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.
-
did you run update.php
-
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.
-
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.
-
Read again how it works (first post of this thread)
-
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
-
from the first post
...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.
-
Thanks a lot Stramm.
-
YES! I made it working now! Great! Thanks Stramm.
http://litrato.dstbox.com
-
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.
-
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 !!
-
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
-
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)...
-
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
-
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
-
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.
-
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
-
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
-
-lang/english.php
if you edited as suggested english.php then switch to english US to do the settings
-
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
-
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.
-
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
-
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.
-
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
-
english.php = english US
again: http://www.bukavuonline.com/coppermine/?lang=english
-
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
-
you haven't uploaded all necessary modpack files correctly... please do that again as mentioned in the modpack announcemenmt thread
-
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
-
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.
-
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.
-
Maybe I shouldn't overwrite /albums/ ::)
Everything is working again (and I even upgraded), thanks for the quick response anyway!
-
Sorry I cannot find out which files these are to edit as part of the watermark Mod?
Thanks
-delete.php
find
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"> </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"> </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"> </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
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"> </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"> </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"> </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
$files = array($dir . $file, $dir . $CONFIG['normal_pfx'] . $file, $dir . $CONFIG['thumb_pfx'] . $file);
replace with
$files = array($dir . $file, $dir . $CONFIG['normal_pfx'] . $file, $dir . $CONFIG['orig_pfx'] . $file, $dir . $CONFIG['thumb_pfx'] . $file);
find
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
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
$files=array($dir.$file, $dir.$CONFIG['normal_pfx'].$file, $dir.$CONFIG['thumb_pfx'].$file);
replace with
$files=array($dir.$file, $dir.$CONFIG['normal_pfx'].$file, $dir.$CONFIG['thumb_pfx'].$file, $dir.$CONFIG['orig_pfx'].$file);
searchnew.php
find
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
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 ;) )
-
First line you quoted:
-delete.php
find
Further down one can read:
editpics.php
find
and
searchnew.php
find
What was the question?
-
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
-
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.
-
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
-
... 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)
...
-
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?
???
-
Posting the details might help, e.g. a link to your gallery and a deep link to your watermarking image.
-
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.
-
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.
-
then do as I told you yesterday
http upload a file...
-
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.
-
Stramm
I deleted the only image I had, reloaded a new image and presto, the watermark was there. Sorry for any confusion.
-
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)
-
Just for the record: tools recommended to batch-watermark images on your client before upload:
- Picture Shark (http://www.picture-shark.com/)
- PMnet watermark (http://pmnet.info/watermark/)
Both tools are free
-
i cant find anything in delete.php
-
i cant find anything in delete.php
what do you want to tell me with that?
-
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
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!
-
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!!!
-
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!!
-
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.
-
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!
-
try watermark downsizing
http://forum.coppermine-gallery.net/index.php/topic,29817.msg143122.html#msg143122
-
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!
-
>.< 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!
-
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
-
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...
-
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?
-
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.
-
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
-
Post links, properly chmod files and folders
-
Hi
Files and folders are chmoded well i suppose.
What chmod must i apply to searchnew.php ?
-
with files and folders I mean the images and the containing folders and please do as I suggested
-
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 ?
-
I never said you should do anything to searchnew.php. I told you to post links!
-
Links of what ?
To see something you must be admin.
In the first page of this topics, searchnew.php must be modified.
-
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 ;)
-
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