Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: 1 2 [3] 4 5 6 7 ... 15   Go Down

Author Topic: Permanant watermark with undo possibility (GD2+IMagick)  (Read 273554 times)

0 Members and 1 Guest are viewing this topic.

freesouljah

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 116
  • Can you feel the Love?
    • freesouljah.com
Re: Permanant watermark with undo possibility (GD2+IMagick)
« Reply #40 on: April 17, 2005, 10:10:50 pm »

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

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: Permanant watermark with undo possibility (GD2+IMagick)
« Reply #41 on: April 19, 2005, 05:16:44 pm »

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

  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 7
Re: Permanant watermark with undo possibility (GD2+IMagick)
« Reply #42 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
Code: [Select]
cpg_configTo say what fit my database table like this:
Code: [Select]
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
Code: [Select]
  '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:
Code: [Select]
  'wm_resized' => 'resized',
as you have us modify that in the:
Code: [Select]
function form_watermark

I also noticed that my "O" when I deleted a file didn't have a definition it looked like this:
Code: [Select]
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


Logged

Stramm

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: Permanant watermark with undo possibility (GD2+IMagick)
« Reply #43 on: April 21, 2005, 08:04:45 pm »

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

Code: [Select]
'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

  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 7
Re: Permanant watermark with undo possibility (GD2+IMagick)
« Reply #44 on: April 21, 2005, 08:16:31 pm »

Quote
K, 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.
Code: [Select]
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.
« Last Edit: April 22, 2005, 09:06:12 am by bangerkcknbck »
Logged

Stramm

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: Permanant watermark with undo possibility (GD2+IMagick)
« Reply #45 on: April 22, 2005, 08:55:49 am »

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

bloodynipples

  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 9
    • Emerald Bay Alumni
Re: Permanant watermark with undo possibility (GD2+IMagick)
« Reply #46 on: April 23, 2005, 01:28:39 am »

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.
« Last Edit: April 23, 2005, 01:56:37 am by bloodynipples »
Logged

Stramm

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: Permanant watermark with undo possibility (GD2+IMagick)
« Reply #47 on: April 23, 2005, 10:44:04 am »

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
Code: [Select]
@mkdir($CONFIG['fullpath'].'edit',0666);and replace 0666 with 0777

freesouljah

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 116
  • Can you feel the Love?
    • freesouljah.com
Re: Permanant watermark with undo possibility (GD2+IMagick)
« Reply #48 on: April 27, 2005, 07:18:45 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
Code: [Select]
cpg_configTo say what fit my database table like this:
Code: [Select]
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

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 67
Re: Permanant watermark with undo possibility (GD2+IMagick)
« Reply #49 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.

bangerkcknbck

  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 7
Re: Permanant watermark with undo possibility (GD2+IMagick)
« Reply #50 on: May 03, 2005, 08:03:20 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.
Logged

Dice

  • Coppermine newbie
  • Offline Offline
  • Posts: 2
Re: Permanant watermark with undo possibility (GD2+IMagick)
« Reply #51 on: June 13, 2005, 07:31:22 am »

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.
Logged

Stramm

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: Permanant watermark with undo possibility (GD2+IMagick)
« Reply #52 on: June 13, 2005, 10:33:45 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

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: Permanant watermark with undo possibility (GD2+IMagick)
« Reply #53 on: June 13, 2005, 10:35:53 am »

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

  • Coppermine newbie
  • Offline Offline
  • Posts: 2
Re: Permanant watermark with undo possibility (GD2+IMagick)
« Reply #54 on: June 13, 2005, 01:54:50 pm »

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

Logged

rcsmith

  • Coppermine newbie
  • Offline Offline
  • Posts: 11
Re: Permanent Watermark with GD2 mod mod
« Reply #55 on: June 21, 2005, 07:08:39 pm »

now delete.php

find a block similar to the one below and replace (just colspan has been adjusted)
Code: [Select]
    // 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
Code: [Select]
<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?
Logged

Stramm

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: Permanent Watermark with GD2 mod mod
« Reply #56 on: June 22, 2005, 08:54:12 am »

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

  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 18
Re: Permanant watermark with undo possibility (GD2+IMagick)
« Reply #57 on: June 23, 2005, 07:37:15 am »

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
Logged

Stramm

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: Permanant watermark with undo possibility (GD2+IMagick)
« Reply #58 on: June 23, 2005, 08:44:18 am »

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

  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 18
Re: Permanant watermark with undo possibility (GD2+IMagick)
« Reply #59 on: June 23, 2005, 04:35:47 pm »

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
« Last Edit: June 23, 2005, 06:30:28 pm by djmac »
Logged
Pages: 1 2 [3] 4 5 6 7 ... 15   Go Up
 

Page created in 0.032 seconds with 19 queries.