Advanced search  

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

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

Author Topic: Watermarking hack (w/ ImageMagick)  (Read 210133 times)

0 Members and 1 Guest are viewing this topic.

djboxny

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 45
    • Latin Videos and much More
Possitioning didnot work
« Reply #60 on: March 05, 2004, 05:29:04 pm »

well tried to possition the watermark on the bottom of the pictures so i changed southeast to northwest but din't work at all.  it stays at the top left corner.  the link is www.djboxny.com/gallery1
Logged

flex

  • Contributor
  • Coppermine novice
  • ***
  • Offline Offline
  • Posts: 29
Watermarking hack (w/ ImageMagick)
« Reply #61 on: March 05, 2004, 06:00:04 pm »

Northwest would be the top left corner of the picture anyway...

North = top
Northeast = top right
East = right
Southeast = bottom right
South = bottom
Southwest = bottom left
West = left
Northwest = top left
Logged
jvcam.co.uk

flex

  • Contributor
  • Coppermine novice
  • ***
  • Offline Offline
  • Posts: 29
Re: Watermark with text instead of PNG
« Reply #62 on: March 05, 2004, 06:05:02 pm »

Quote from: "bshrdr"
Well, I took this cool little hack a step further.  Instead of creating a PNG offline (which was no real problem - it just didn't suit my needs), I wanted to just use plain old text.  So I came up with this, which creates a small PNG on the fly.  


Nice work! I had considered doing something similar but now there's no need! I think this would be a great way of putting watermarking into coppermine since you control it all from the control panel, instead of having to upload images etc.

The one thing I did look at was trying to use different fonts for the text, but I didn't get very far with the GD/Imagemagick functions for this...
Logged
jvcam.co.uk

djboxny

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 45
    • Latin Videos and much More
Still
« Reply #63 on: March 05, 2004, 06:42:36 pm »

It is at southeast and still appears at the top left no matter to what i change it too.  this is the code i have inplemted
Code: [Select]
<?
define('IN_COPPERMINE', true);
require('include/init.inc.php');

header('Content-Type: image/jpeg');
header('Content-Disposition: inline; filename=file.jpg');

$pid = $_REQUEST["pid"];
$mode = $_REQUEST["mode"];

$sql = "SELECT * FROM ".$CONFIG['TABLE_PREFIX']."pictures WHERE pid=$pid";
$db = mysql_connect($CONFIG['dbserver'], $CONFIG['dbuser'], $CONFIG['dbpass']);
mysql_select_db($CONFIG['dbname'], $db);


$result = mysql_query($sql, $db);
$row = mysql_fetch_array($result);

$pic_prefix = array(
    'thumb' => $CONFIG['thumb_pfx'],
    'normal' => $CONFIG['normal_pfx'],
    'fullsize' => ''
);


$cmd = "{$CONFIG['impath']}composite -compose over -gravity Southeast \"".realpath("./watermark.png")."\" \"".realpath('./'.$CONFIG["fullpath"].$row["filepath"].$pic_prefix[$mode].$row["filename"])."\" jpg:-";

passthru ($cmd, $output);

echo $output;
?>



is this correct
Logged

flex

  • Contributor
  • Coppermine novice
  • ***
  • Offline Offline
  • Posts: 29
Watermarking hack (w/ ImageMagick)
« Reply #64 on: March 05, 2004, 07:19:53 pm »

Hmm that's very strange, it all looks ok to me... By default gravity is set to Northwest but I have no idea why it's not working when you set it to Southeast...

Any ideas what version of imagemagick you're using? I guess it could be a bug with an older version...
Logged
jvcam.co.uk

golf16vkr

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 28
Watermarking hack (w/ ImageMagick)
« Reply #65 on: March 05, 2004, 10:31:34 pm »

Is it possible to but the logo's in for outside linking ?

I have searched the board but it's not quite clear to me.

I hope this is not seen as spamming and someone can help me out.

Thanks in advance
Logged

FreeMail

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 67
    • http://www.myphotodb.com
Watermarking hack (w/ ImageMagick)
« Reply #66 on: March 06, 2004, 05:03:31 pm »

Quote from: "flex"
Ok I've created a generic coppermine watermark for those having trouble creating one in photoshop/paintshop pro and don't want to use the one I posted (obviously).

I'm still looking at the thumbnail watermark problem.. just takes a while for my head to get round the code again.

Here's the generic watermark:
http://www.jvcam.co.uk/coppermine/watermark-cpg.png

You'll need to rename it to watermark.png for it to work with the script.[/php]



i tried the watermark-cpg.png file but i get a X mark, any tip on how i can solve this?  :roll:

tia!
Logged

flex

  • Contributor
  • Coppermine novice
  • ***
  • Offline Offline
  • Posts: 29
Watermarking hack (w/ ImageMagick)
« Reply #67 on: March 07, 2004, 01:50:10 pm »

Quote from: "FreeMail"

i tried the watermark-cpg.png file but i get a X mark, any tip on how i can solve this?  :roll:


Ok you can try editing wm.php to echo the imagemagick command to see if it's constructing it correctly.

Code: [Select]

<?  
define('IN_COPPERMINE', true);  
require('include/init.inc.php');  

// header('Content-Type: image/jpeg');  
// header('Content-Disposition: inline; filename=file.jpg');  

$pid = $_REQUEST["pid"];  
$mode = $_REQUEST["mode"];  

$sql = "SELECT * FROM ".$CONFIG['TABLE_PREFIX']."pictures WHERE pid=$pid";  
$db = mysql_connect($CONFIG['dbserver'], $CONFIG['dbuser'], $CONFIG['dbpass']);  
mysql_select_db($CONFIG['dbname'], $db);  


$result = mysql_query($sql, $db);  
$row = mysql_fetch_array($result);  

$pic_prefix = array(  
    'thumb' => $CONFIG['thumb_pfx'],  
    'normal' => $CONFIG['normal_pfx'],  
    'fullsize' => ''  
);  


$cmd = "{$CONFIG['impath']}composite -compose over -gravity Southeast \"".realpath("./watermark.png")."\" \"".realpath('./'.$CONFIG["fullpath"].$row["filepath"].$pic_prefix[$mode].$row["filename"])."\" jpg:-";  

echo $cmd;

//passthru ($cmd, $output);  

//echo $output;  
?>


Try that and then call the image directly on one of your images. I tried looking at your gallery but it seems your having a few account problems with it, so let me know when you've done the above editing and we'll try get this sorted out.

Flex :)
Logged
jvcam.co.uk

FreeMail

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 67
    • http://www.myphotodb.com
Watermarking hack (w/ ImageMagick)
« Reply #68 on: March 07, 2004, 01:59:37 pm »

thanks for the tip!

my webhost got hacked by one of its subscriber! sigh!  :lol: everything wiped out according to the webhost!
Logged

djboxny

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 45
    • Latin Videos and much More
Hey
« Reply #69 on: March 07, 2004, 09:10:23 pm »

Let us know what hosting company your are with so we don't go to that company and get hacked too :roll:
Logged

jamaman83

  • Coppermine newbie
  • Offline Offline
  • Posts: 1
    • http://www.shamelessco.com
hi
« Reply #70 on: March 10, 2004, 11:19:59 pm »

I did all the stuff in the hack but i get X when viewing normal or full sized images, when i launch the wm script by itself with the correct options it just returns a value of 1.

Pleas help thanks
Logged

smidge

  • Coppermine newbie
  • Offline Offline
  • Posts: 7
Watermarking hack (w/ ImageMagick)
« Reply #71 on: March 19, 2004, 07:36:12 pm »

Hi Flex/Gaugau, I love the script, it works beautifully for me. I was just curious about a quick addition.

Is there a way to turn off the watermark if the image was uploaded by a user? Seems like it would just be a simple if-then statement in there but I don't know anything about php or the variables for the users.

I only ask because my brother got upset when he saw my watermark on his pictures.

And another nice feature would be to specify the watermark by which user the picture belongs to. But I don't really care about that for now.

If you don't have time, could you just give me the variable for users in general and I'll fool around with it? Thanks.

http://www.tedesigns.org
Logged

hyperion

  • VIP
  • Coppermine addict
  • ***
  • Offline Offline
  • Posts: 1317
  • - retired -
Watermarking hack (w/ ImageMagick)
« Reply #72 on: March 19, 2004, 11:50:33 pm »

This thread should give you some ideas.

http://forum.coppermine-gallery.net/index.php?topic=3269
Logged
&quot;Then, Fletch,&quot; that bright creature said to him, and the voice was very kind, &quot;let&#039;s begin with level flight . . . .&quot;

-Richard Bach, Jonathan Livingston Seagull

(http://www.mozilla.org/products/firefox/buttons/getfirefox_small.png)

jerx

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 85
Slideshow and ecard
« Reply #73 on: March 24, 2004, 06:36:48 pm »

Hello,

I would like to use slideshow and ecard function, but those pictures have no watermark. I think you have to modify slideshow.inc.php and ecard.php. Can anybody help me?

Thank you in advance,

jerx
Logged

smidge

  • Coppermine newbie
  • Offline Offline
  • Posts: 7
Watermarking hack (w/ ImageMagick)
« Reply #74 on: March 25, 2004, 01:29:36 am »

Quote from: "hyperion"
This thread should give you some ideas.

http://forum.coppermine-gallery.net/index.php?topic=3269


Hi hyperion, thanks for the reference. I've actually already looked at that thread before but can't really make out anything. What does $user1, $user2 etc. refer to?

I don't want to implement that code because I would have to go through all of my pictures (almost 900) and individually add the watermark. I tend to batch upload large numbers of pictures at a time as well. If I could just get this code to check and see if the picture was uploaded by a user, that would be great.
Logged

joko

  • Coppermine newbie
  • Offline Offline
  • Posts: 1
Change for VIDEO-hack
« Reply #75 on: April 01, 2004, 04:01:20 am »

I have made some modify for VIDEO-hack.

Find in include/function.inc.php
Code: [Select]

                return $url_prefix[$pic_row['url_prefix']]. path2url($pic_row['filepath']. $pic_prefix[$mode]. $pic_row['filename']);


replace with
Code: [Select]

                if (is_image($pic_row['filename'])) {
                        if((($mode == "normal") || ($mode == 'fullsize')) && ($CONFIG['thumb_method']=='im')){

                                 // return the url to the wm script
                                return "wm.php?pid=".$pic_row["pid"]."&mode=".$mode;
                        }else{
                                // it's a thumb, don't bother wm'ing
                                return $url_prefix[$pic_row['url_prefix']]. path2url($pic_row['filepath']. $pic_prefix[$mode]. $pic_row['filename']);

                        }  
                } else {
                return $url_prefix[$pic_row['url_prefix']]. path2url($pic_row['filepath']. $pic_prefix[$mode]. $pic_row['filename']);
                }                


That's will ok for VIDEO-hack.

ps:I have test this with video-Full package.
Logged

cem

  • Coppermine newbie
  • Offline Offline
  • Posts: 3
Re: Watermarking hack (w/ ImageMagick)
« Reply #76 on: May 28, 2004, 03:22:56 am »

Hi there..

i was trying to add the watermark hack but when it wants to open the pic in full size (so not the thumpnail) i get a X (image not found).
and i dont have any iedea what this could be.

please help..
if you need the files i changed just ask and i mail

Same here and also noticed others have the same problem.. Did you manage to find/fix the problem??

loudone

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 20
  • ALL things web!
    • Web Solutions
Re: Watermarking hack (w/ ImageMagick)
« Reply #77 on: June 01, 2004, 06:12:53 am »

This works great! It is just what I needed! Anyone have input on the slideshow view? It makes it load real slow now.
Logged

shutiri

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 66
Re: Watermarking hack (w/ ImageMagick)
« Reply #78 on: June 02, 2004, 09:55:18 pm »

great...  it's working fine. thank you.

Does anyone knows how to center the wm just in the middle of the image ?

I saw this:
Quote
North = top
Northeast = top right
East = right
Southeast = bottom right
South = bottom
Southwest = bottom left
West = left
Northwest = top left

But I would like to have it just in the middle.

thank you.
shutiri.


Logged

loudone

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 20
  • ALL things web!
    • Web Solutions
Re: Watermarking hack (w/ ImageMagick)
« Reply #79 on: June 03, 2004, 04:27:55 am »

When a user views a full size image, how would you make the watermark larger??  Fits perfect in intermediate view....


Thanks
Logged
Pages: 1 2 3 [4] 5 6   Go Up
 

Page created in 0.027 seconds with 20 queries.