Permanant watermark with undo possibility (GD2+IMagick) - Page 3 Permanant watermark with undo possibility (GD2+IMagick) - Page 3
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

Permanant watermark with undo possibility (GD2+IMagick)

Started by Stramm, March 26, 2005, 06:09:36 PM

Previous topic - Next topic

0 Members and 5 Guests are viewing this topic.

freesouljah

you can use phpMyAdmin to do the sql stuff...just make sure that you insert the code into the right db and that you customize the code to fit your site path to the watermark.

let me know if you get it to work...because I still have the same problem that I listed above  :-\\

Stramm

just adding the sql stuff to one of the files in your coppermine sql folder won't work. You'll have to either use commandline or phpmyadmin to add these to your current db config

bangerkcknbck

freesouljah:
Thanks for your time to post a response.  I had already looked at the thread from Burpee where he noted to do the sql with phpmyadmin or webmin.  It then made sense.  I used webmin and  I did have to modify
cpg_config
To say what fit my database table like this:
cpg132_config

I now have the watermark setup working but never ran into the upload issues you have.  May I suggest trying with a vanilla install of CPG and a clean database then start the mods over?

Stramm:

Thank you very much for the time you spent to create this version and posting your thoughts on what I had to do to get it working.  I had already got it working and had stumbled into a few other issues.

I noticed one issue right away when I got it working and that was I couldn't get the watermark to move to a different spot in the picture.  It took some looking in the files I modified per your directions and your naming system to type into the config options isn't "bottomright" it is "southeast", "northwest" etc. (all lowercase no space and no quotes).

In the section for:
now open lang/english.php
find
$lang_config_php
and add

  'wm_bottomright' => 'Bottom right',
  'wm_bottomleft' => 'Bottom left',
  'wm_topleft' => 'Up left',
  'wm_topright' => 'Up Right',
  'wm_center' => 'Center',
  'wm_both' => 'Both',
  'wm_original' => 'Original',

I think you should have also included:

  'wm_resized' => 'resized',

as you have us modify that in the:

function form_watermark


I also noticed that my "O" when I deleted a file didn't have a definition it looked like this:

F : full size image
N : normal size image
O :
T : thumbnail
C : comment
D : image in album

So I found where I needed to update that and now it displays "Original in album".

But now I have a new issue thats got me stumped.  When I do a single file upload this mod works fine.  When I do a batch add files the resized photo gets the watermark but the original doesn't.  Did I miss something to make this work because I'm unable to figure out how to get it done.

I even created a test gallery and redid every mod exactly as you typed out without changing a single line and I still have the problem in my test gallery.

If you or anyone needs access to this gallery etc to help try to fix this, then  I'll be happy to provide you with whatever you you may need.

Thanks in advance



Stramm

sorry for the wm_bottomright thingie... there was a mixup with the GD only version. Don't change lang_config_php  but have another lang_config_data

'Image watermarking',
array('Watermark Image', 'enable_watermark', 1),
array('Where to place the watermark', 'where_put_watermark', 11),
array('Which files to watermark', 'which_files_to_watermark', 12),
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),


Yes, I've forgotten the last line   'wm_resized' => 'resized',

both things fixed above as well as the typo in delete.php


OK, when you upload a pic (let's say mypicture.jpg) then you have three versions: normal_mypicture.jpg (has watermark), mypicture.jpg (has watermark and is the fullsize image) and orig_mypicture.jpg (no watermark cause that's the backup file in case you want to undo watermarking). This all should work perfect with normal upload, batch modify und batch upload... at least here it does ;)






bangerkcknbck

#44
QuoteK, when you upload a pic (let's say mypicture.jpg) then you have three versions: normal_mypicture.jpg (has watermark), mypicture.jpg (has watermark and is the fullsize image) and orig_mypicture.jpg (no watermark cause that's the backup file in case you want to undo watermarking). This all should work perfect with normal upload, batch modify und batch upload... at least here it does Wink
When I use "Upload file" it places the pictures in \userpics\10001 and I have 4 versions (everything from above and the thumb_ but thats not apart of this script and I understand that).  The mypicture.jpg is the original with the watermark, and has a modified date of the day I uploaded it.

When I do a batch add files I get the same 4 files, in the folder i ftp'd the original into, however it wasn't modified with the watermark.  So basically I have mypicture.jpg and i have orig_mypicture.jpg that are identical.  The script never watermarked mypicture.jpg.  mypicture.jpg still has the original file date when it was taken, not the date it was batched through like the 3 new files.


**Edit**
My pictures were not set to read/write.  I did a chmod 666 for each of the pictures and then did a batch upload and it worked peachy.

I would like to know if there is a way to make it so when I do a batch upload I don't get the broken picture links that are for the "DP" signs.  I would like them to show "OK" signs since they are uploading successfully, but that really is nitpicky I'm sure.

I did add one other thing to your script though for my own likes.

In picmgmt.inc.php I added this in the section where you are setting the cooridnates where the watermark will show up.
else if ($pos == "southcenter") {
$src_x = ($destWidth/2) - ($logoW/2);
$src_y = ($destHeight/2) - $logoH + 70;
}


The number 70 after $logoH slides the watermark down 70 pixels.  I prefer this over having a watermark right in the center as most head shot pictures would have the watermark right across the face.  Ofcourse you can change the number 70 to whatever suits your needs to move the watermark around.

Stramm

does mypicture.jpg and orig_mypicture.jpg have a different file size?

bloodynipples

#46
I am EXTREMELY frustrated. 

I have been trying to get my 1.2.1 upgraded to 1.3.3 all day long.  This was supposed to take 30 minutes this morning!!!!

I cannot seem to figure out what the problem is, but picmgmt.inc.php and upload.php don't seem to play nice once this watermarking hack is installed on version 1.3.3.  I will continue to beat on it, but for now, I am going to keep the old 1.3.2 version of picmgmt.inc.php to do the dirty work of watermarking. 

very, very, very frustrated.

Stramm

picmgmt.inc.php are identical for 1.3.2 and 1.3.3 except one lil chmod thing. So just use the modified version on top.
If you want the lil change then search for
@mkdir($CONFIG['fullpath'].'edit',0666);
and replace 0666 with 0777

freesouljah

Quote from: bangerkcknbck on April 21, 2005, 09:16:40 AM
freesouljah:
Thanks for your time to post a response.  I had already looked at the thread from Burpee where he noted to do the sql with phpmyadmin or webmin.  It then made sense.  I used webmin and  I did have to modify
cpg_config
To say what fit my database table like this:
cpg132_config

I now have the watermark setup working but never ran into the upload issues you have.  May I suggest trying with a vanilla install of CPG and a clean database then start the mods over?



it may have something to do with the phpbb bridge....I will try it once more....and if I don't get it working, I will give it up and try a different watermark mod.

cdrake

Is it suppose to automatically watermark for batch upload only? because It doesnt add a watermark thats added through the regular upload process.

bangerkcknbck

Quote from: cdrake on May 03, 2005, 12:26:30 AM
Is it suppose to automatically watermark for batch upload only? because It doesnt add a watermark thats added through the regular upload process.

May I suggest reading post #44?  I could watermark on single picture upload, but had to chmod the files to 666 on batch.  Both processes work just fine.

Dice

Just a Question with the mod....

Everything works fine.... but I have come across with one small problem.. it seems to not be watermaking the pics that dont need a resize

Like if I upload a pic that is larger than what it will show, it will resize it, and create the 4 files as mentioned in above posts.

But when you upload a pic that is not going to be resized as its smaller than the resize settings, it does not watermark
any of the pics and the "normal_mypicture.jpg" is missing completely. Only "mypicture.jpg" and "orig_mypicture.jpg"
are uploaded into the folder (as well as the thumb). The "mypicture.jpg" does not get watermarked at all....

As I said it works fine for when you upload an oversized picture, but not for non resized pictures.

Anyhelp would be appreciated to maybe a slolution for this prob. Thanks is advance.

Stramm

Quote from: Dice on June 13, 2005, 07:31:22 AM
But when you upload a pic that is not going to be resized as its smaller than the resize settings, it does not watermark
any of the pics and the "normal_mypicture.jpg" is missing completely.

uhps... sorry
It's fixed now. Please update your picmgmt.inc.php

Stramm

and I've written a lil addition for batch changes so you won't have to click for each bunch the submit button. With a few thousand images that'll need ages. Now it's 'auto pressing' it and you just run the batch process and leave it running till it's finished. If anyone needs it...

Dice

Quote from: Stramm on June 13, 2005, 10:33:45 AM
uhps... sorry
It's fixed now. Please update your picmgmt.inc.php

Thanks so much Stramm, you fixed that so quick....
Works perfectly now....

Big thanks to all the work that you have put into this mod....  ;D


rcsmith

Quote from: Stramm on March 26, 2005, 06:39:12 PM
now delete.php

find a block similar to the one below and replace (just colspan has been adjusted)
    // Picture

    case 'picture':
        if (!(GALLERY_ADMIN_MODE || USER_ADMIN_MODE)) cpg_die(ERROR, $lang_errors['access_denied'], __FILE__, __LINE__);

        $pid = (int)$HTTP_GET_VARS['id'];

        pageheader($lang_delete_php['del_pic']);
        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";
        echo "<div class=\"admin_menu_thumb\"><a href=\"thumbnails.php?album=$aid\"  class=\"adm_menu\">$lang_continue</a></div>\n";
        echo "</td></tr>\n";
        endtable();
        pagefooter();
        ob_end_flush();
        break;



do the same with this block
<tr>
<td class="tableh2"><b>Picture</b></td>
<td class="tableh2" align="center"><b>F</b></td>
<td class="tableh2" align="center"><b>N</b></td>
<td class="tableh2" align="center"><b>O</b></td>
<td class="tableh2" align="center"><b>T</b></td>
<td class="tableh2" align="center"><b>C</b></td>
<td class="tableh2" align="center"><b>D</b></td>
</tr>
<?php
}

function 
output_caption()
{
    global 
$lang_delete_php
    ?>

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





I don't quite understand this.  You use the same code twice in delete.php??  or do you replace the 2nd code with the one on this page?

Stramm

Quote from: rcsmith on June 21, 2005, 07:08:39 PM
I don't quite understand this.  You use the same code twice in delete.php??  or do you replace the 2nd code with the one on this page?

have a look at the first code block... now look for a similar one in delete.php and replace the found one with the one shown here. When done look at the second code block, find something similar in delete.php and replace with the given one here. As said, only lil changes here in the table layout to have two more cells.

djmac

Stramm

The mod you have posted. Is that MOD complete? Is it a MOD without typos, missing lines and so forth? I ask this because I have installed your mod and I get no errors what so ever. But it doesn't add the watermark either. I have tried it under imagemagick, and GD2. I am running CPG133. I have read every message in this database about your MOD and I can't find anything that might help. Pleeeeeeease Help me or I'm going into the garage and find a beam.

BTW Great work. You have obviously put a lot of effort in to this MOD.

Regards
Don

Stramm

Have you added the SQL? And you've entered the absolute path to the wm image?

When modifying the config and you check after saving it... this works?

djmac

Stramm

Yes, I added the SQL, used the complete server path and the information saves in the config. Let me through this in the mix. My SQL prefix is djmac200_config. I also tried Burpee's MOD first and that didn't work either. Then I seen your MOD and felt it would better suit my needs. Let me know if you need to get into it and I will PM you with anything you need.

Regards
Don