Another watermark mod (simpliest available) GD2 compatiable - Page 2 Another watermark mod (simpliest available) GD2 compatiable - Page 2
 

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

Another watermark mod (simpliest available) GD2 compatiable

Started by skybax, August 14, 2004, 10:44:29 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

skybax

I'm in the process of rewriting the code so that it has it's own field and can be controlled site wide via config. I am also working on adding hooks so that it can be writen in as a plugin once that is released in stable. Since I was out all last week from flooding and schedules I am getting back in the groove on testing the mods. I hope to release the finalized version sometime soon.

-T
(https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2Fwww.skybax.com%2FhotImage%2Fpost_footer.gif&hash=338b65c57a59f0b06311094e697c87794e43d945)
Don't contact me for support over PM or email unless I requested you to do so. Instead: post on the proper board.

squish

I managed to figure it out, when I was commenting out that first like, I also commented out the squiggle ( } ) that was right below it.

Thanks the help

crashnet

Well, I got it to say something, but each time I click on an image that I have applied the watermark to, I get ths error:

QuoteWatermarking file: images/watermark.png did not work!

The watermark image is in the right folder, the word "watermark" is in user1, and I checked and rechecked watermark.class.php.  I have to remove the mod in order to be able to view any of my images again.  What would cause this error?  Am I supposed to modify this stuff, and if so, can you be a little more detailed as of what you are asking to change these paths too.  The wording is a litte confusing.

class Watermark
    {
        /**
        * Directory where the created watermarked images are stored in (for PHP access)
        * e.g. '/usr/local/apache/htdocs/images/watermark'
        */
        var $thumbnail_dir_internal  =  '/home/erotic/public_html/wmarked/';
        /**
        * Path to watermarked directory for browser/coppermine access
        * e.g. '/images/thumbnails'
        */
        var $thumbnail_dir_external  =  '../wmarked/';
/**
        * Watermarked image suffix for new watermarked image
        * e.g. 'watermarksuffix_orginal.jpg'
        * WARNING: Cannot be left blank
        */
var $file_suffix = 'watermark_';
        /**
        * Error message if creation fails, this will crash the gallery for the particular image if all fails...
        */
        var $error;
        /**
        * where the watermark is inserted
        * topleft, bottomleft, topright, bottomright
        */
var $watermark_position = "bottomright";
        /**
        * the watermark filename
* currently MUST be a PNG24 file! working on gif/jpg support
        */
var $watermark_file;
        /**
        * which kind of output is request
        * valid value is JPG, PNG*
*    * if using PNG - look @ www.skybax.com for more information on how to secure images
*      (neat transparency effect that disables 'easy' harvesting of images)
        */
var $extension = 'JPG';
        /**
* this method REQUIRES the GD 2.0+
        * @param string $imagefile Filename of source image
        */



trouble

is it supposed to work on windows server? i ve done everything as described in this forum, but i get the following error when trying to view the image.

Warning: imagecreatefromjpeg(albums/userpics/10001/thumb_DSC00267%20%28Large%29.JPG): failed to open stream: No such file or directory in
D:\My Webs\anglija.com\webroot\album\include\watermark.class.php on line 176
Could not create from JPEG

any ideas?

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

ok i fixed it. I will leave this post should it help anyone.
1. file name was a problem. it doesnt like filenames with anything in it, except basic charachters.
2. need to give write permission rigths to "wmarked" folder. In windows its done via security option on folder right-click menu.
3. had to change $thumbnail_dir_external variable to full path from root. dunno why it didnt like the original one. i changed it to:
var $thumbnail_dir_external  =  '/album/wmarked/';
4. i dont remember what else i done, sorry im a bit drunk.

any problems gimme a shout. i may be able to help. you can see my watermarks in action at http://www.anglija.com/album/displayimage.php?album=7&pos=1 :o)

would be kool if anyone could fix this problem with filenames. cause its really complicated to force everyone to upload pics with certain naming rules - its rather impossible.

trouble

anyone who has problems with file names, and want to use chars like: + = & - ( )  etc.. in file names, could use this quick fix solution:
in file "functions.inc.php" find a line:
"$picture_location = $url_prefix[$pic_row['url_prefix']]. path2url($pic_row['filepath']. $pic_prefix[$mode]. $pic_row['filename']);;"

and insert this line straight after that:
$picture_location = rawurldecode($picture_location);

should do the trick.

erroneus

Quote from: trouble on September 12, 2004, 05:28:00 PM
anyone who has problems with file names, and want to use chars like: + = & - ( )  etc.. in file names, could use this quick fix solution:
in file "functions.inc.php" find a line:
"$picture_location = $url_prefix[$pic_row['url_prefix']]. path2url($pic_row['filepath']. $pic_prefix[$mode]. $pic_row['filename']);;"

and insert this line straight after that:
$picture_location = rawurldecode($picture_location);

should do the trick.

awesome! thanks! the filename problem was pretty much the only thing preventing me from using this great watermark mod. Will this allow filenames with spaces too now?

nugget

what do you mean with "comment the code out" sry my english is baad ;)

Tranz

Commenting methods depend on the code. Please specify where you saw that suggestion and which code it pertains to.

jojo3ep

I have installed this hacks, but even if I have followed all recommandations posted, no watermark is added to my picture even I hae added to user file 1 : yes !
What can I do ? I have to error message but as well no watermark ! Thanks

skybax

please provide a sample link and the code for the class you are using.

-T
(https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2Fwww.skybax.com%2FhotImage%2Fpost_footer.gif&hash=338b65c57a59f0b06311094e697c87794e43d945)
Don't contact me for support over PM or email unless I requested you to do so. Instead: post on the proper board.

irishblue

thanks for this mod! Got it working great.
Except it doesn't seem to appear on the portrait oriented pictures, only the landscape ones. Any idea how to fix that?

skybax

it should work - however it may depend on the size of your pictures - if the math determines the picture is too small so that your watermark doesn't engulf the image...

-T
(https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2Fwww.skybax.com%2FhotImage%2Fpost_footer.gif&hash=338b65c57a59f0b06311094e697c87794e43d945)
Don't contact me for support over PM or email unless I requested you to do so. Instead: post on the proper board.

irishblue

ah ok thanks! :) Yeah might be that the image is too small.
Got another question, is the script supposed to watermark the thumbnails too?
I have a 1064 x 1600 pixels image, but only the full-sized version gets watermarked, but the thumbnail on the individual viewing (displayimage) page doesn't.

If its not supposed to, is it possible to set it to do so? perhaps use a smaller version or separate watermark image so it fits the thumbnail?

skybax

the script excludes the thumbnails because I found that watermarks looked really crappy shrunk - however it is possible... and you can set it up so that it uses a different wmark for the thumbnail you would just have to modify the code for dispalying the thumbnails... (theme.php i believe)
(https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2Fwww.skybax.com%2FhotImage%2Fpost_footer.gif&hash=338b65c57a59f0b06311094e697c87794e43d945)
Don't contact me for support over PM or email unless I requested you to do so. Instead: post on the proper board.

irishblue

is it possible to just get it to shrink the watermark together with the pic?
if so, which file should i make the changes to?
the separate watermark sounds complicated and i'm not very good with code  ???

Tranz

What you can do is, after watermarking the larger photos, go into admin tools. There is an option to regenerate the thumbnails. The new thumbnails will be using the watermarked files so the watermarks will show up on thumbnails. That's what happened to my files, though I did not want watermarks on my thumbnails.

irishblue

i tried that once while experimenting with the sizes. I went into admin tools after watermarking and regenerated the thumbnails. and all the files even the actual sized ones were grabbing files from the e.g. userpic/10001 folder instead of the wmarked folder. so all ended up w/o watermarks.

atommyk

QuoteI wanted to be able to specify which images to watermark indivually within an album.
I don't know if this information can be found in your post, but is there a "standard-value" for the user1-field? Because if I undertand right, I would have to label each picture with user1-field "yes" manually - tell me that I'm wrong ;)

skybax

you are correct about manually inputting all the value to turn on the watermarking feature.
(https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2Fwww.skybax.com%2FhotImage%2Fpost_footer.gif&hash=338b65c57a59f0b06311094e697c87794e43d945)
Don't contact me for support over PM or email unless I requested you to do so. Instead: post on the proper board.

davidshook

I am sorry if this is answered somewhere in this thread allerady.
How exactly does this MOD work:
1) do all the batch uploaded pictures get watermarked?
-- or, do I get to chose if batch uploaded pictures get watermarked?

2)  do individual uploaded pictures get water marked?
-- do users/members (as opposed to admin level) have any control over the water marking process in this case.

3) what happens when a user uploads video, mp3, zip, pdf file?
-- does the upload faile?
-- does the file become unreadable?


The reason I am asking this is because I am designing a site that will have  a gallery that allows loged-in members to upload there own pictures/videos/documents. I want to have a watermark on the pictures that the users upload. The user should not be able to upload a picture without a water mark (although it is ok if they have a choice where to place the watermark on the picture)

The rest of the galleries are not for uploads by users. For these galleries I do the batch uploading and the pictures are already watermarked on my desktop pc prior to upload.

So, to some it up: all pictures that are uploaded via http/form need to be watermarked.
Batch files should not be watermarked.
Non-picture files should not be a problem (since I do not limit the file type to be uploaded)


I also think that anyone that thinks about using water marking should have these answers before going through the work of installing and testing the MOD's.

Please help, thank's in advance