Permanent Watermark with GD2 - Page 9 Permanent Watermark with GD2 - Page 9
 

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]

Main Menu

Permanent Watermark with GD2

Started by Burpee, June 20, 2004, 11:43:25 PM

Previous topic - Next topic

0 Members and 7 Guests are viewing this topic.

undeshila

Quote from: Stramm on August 04, 2005, 08:08:34 PM
you'll have to modify the code for that
open util.php and find function updatethumbs()
a few lines below you'll see
    $query = "SELECT * FROM $picturetbl WHERE aid = '$albumid'";

replace it with
    $query = "SELECT * FROM $picturetbl";


now it doesn't matter what album you set in the admin tools... coppermine will just process them all




i did the modification , but unfortunatelly its only watermarking the album chosen , not all of them

Stramm

Then you've changed the wrong line... read again, find the function updatethumbs() and a few lines below find the line you'll have to edit

undeshila

no , there's only one part of the code with both specifications

take a look @ the photo (https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2Fwww.undecided.ro%2Fcode.jpg&hash=83937673343786b6655e8e77b2a2a09b6fda7fd5)

Stramm

OK, reverse engineering.. the author has introduced a new function vesileimaathumbit() that's modifying the watermarked pics. I just used the existing one.. therefore the confusion

find it and a few lines below you'll see
   $query = "SELECT * FROM $picturetbl WHERE aid = '$albumid'";
replace with
   $query = "SELECT * FROM $picturetbl";


sigepjedi


Joachim Müller

cpg1.4 goes unsupported, please stop posting issues related to it.

pisaleve

it is possible to place watermark in the original image and resize?
I modified form in the page: config.php

       <td class="tableb" valign="top">
                               <input type="Checkbox" name="$name" class="listbox" value="both" $both_selected>{$lang_config_php['wm_both']}</option>
                               <input type="Checkbox" name="$name" class="listbox" value="original" $original_selected>{$lang_config_php['wm_original']}</option>
                               <input type="Checkbox" name="$name" class="listbox" value="resized" $resized_selected>{$lang_config_php['wm_resized']}</option>
               </td>

But exactly selecting both, he does not function ...
An image only is with watermark

Soulmaster

getting this error

Warning: imagecreatefrompng(/c://apachefriends/xampp/htdocs/gallery/images/watermark.png) [function.imagecreatefrompng]: failed to open stream: Invalid argument in C:\apachefriends\xampp\htdocs\gallery\include\picmgmt.inc.php on line 302

Warning: imagesx(): supplied argument is not a valid Image resource in C:\apachefriends\xampp\htdocs\gallery\include\picmgmt.inc.php on line 303

Warning: imagesy(): supplied argument is not a valid Image resource in C:\apachefriends\xampp\htdocs\gallery\include\picmgmt.inc.php on line 304

Warning: imagecopy(): supplied argument is not a valid Image resource in C:\apachefriends\xampp\htdocs\gallery\include\picmgmt.inc.php on line 321

Warning: imagecreatefrompng(/c://apachefriends/xampp/htdocs/gallery/images/watermark.png) [function.imagecreatefrompng]: failed to open stream: Invalid argument in C:\apachefriends\xampp\htdocs\gallery\include\picmgmt.inc.php on line 302

Warning: imagesx(): supplied argument is not a valid Image resource in C:\apachefriends\xampp\htdocs\gallery\include\picmgmt.inc.php on line 303

Warning: imagesy(): supplied argument is not a valid Image resource in C:\apachefriends\xampp\htdocs\gallery\include\picmgmt.inc.php on line 304

Warning: imagecopy(): supplied argument is not a valid Image resource in C:\apachefriends\xampp\htdocs\gallery\include\picmgmt.inc.php on line 321

dunno what it means
Whoeps wrong planet

sigepjedi

Quote from: GauGau on August 26, 2005, 05:41:53 PM
cpg1.4 goes unsupported, please stop posting issues related to it.

i didnt realize asking about a MOD or HACK fell into ANYTHING to do with the fact that 1.4 is unsupported.
Are you implementing that a "HACK" is supported????

- Now back to your regularly sched program.

Joachim Müller

This is a mod that was made for cpg1.3.x. You repeatedly asked for this mod to be ported for cpg1.4.x. That's very selfish behaviour in the first place, you could have ported it yourself and shared your findings. However, you chose to bump, that's why I told you to stop. In fact, we don't want you to use cpg1.4.x yet if you have no idea how to port the mods and hacks you need over from cpg1.3.x to cpg1.4.x, as this means that you're not experienced enough to use cpg1.4.x yet. Of course we can't stop you from using cpg1.4.x, but we can try to stop you from cluttering threads that deal with cpg1.3.x stuff with your questions that are related to an unsupported version. Imo we have a different concept of what "unsupported actually means, however I suggest you respect our concept of the word.

@all: please do not reply to this thread to ask for a port to another version, will you?

RJPotts

#170
Quote from: partypics on January 09, 2005, 04:51:25 PM
Hello!
I used this mod and added an ability to choose between image watermark and a simple text watermark.
<snip>

Hi,

I had this text watermark mod added to my gallery, working successfully both for uploaded files and admin use on previously uploaded files.

I was recently notified of an error during uploading, ".....failed to open stream: Permission denied.....", I did some digging around on here and discovered that it was a result of the CHMOD settings on the albums directory which I then changed to 755.  I can only presume that my hosts recent 'upgrade' of their servers accounted for the permissions having been changed as several hundred pictures had been uploaded and no coppermine / mod files altered.

After setting the permissions back to what they should be I tried uploading a sample file, it uploaded ok but when I selected the folder etc for in to be placed in I got the error message "Fatal error: Call to undefined function: imagettftext() in /home/cameyinf/public_html/gallery/include/picmgmt.inc.php on line 356".  As that line was related to the mod I removed the modded files and replaced them with the original coppermine versions and I was able to upload successfully. 

I then added the image watermark mod & it worked as advertised, when I (very carefully!) added the text watermark mod the problem (Fatal error: Call to undefined function: imagettftext() in /home/cameyinf/public_html/gallery/include/picmgmt.inc.php on line 356) returns.

Has anyone come across this problem before & is able to tell me whats gone wrong?  I did try searching the library but couldnt find anything relevant, if it has been discussed before I apologise & hope someone might point me in the right direction.

TIA
Richard

PS, I never had config menu entries for the text watermark mod (during original install or the new install today) but it didnt really matter as set it up manually in phpmyadmin, did anyone else find this?

Stramm

you need to recompile php with support for imagettftext enable-gd-native-ttf

RJPotts

Quote from: Stramm on October 04, 2005, 09:16:46 AM
you need to recompile php with support for imagettftext enable-gd-native-ttf

Many thanks indeed.

I've just been on a googling trip to try & find out how to do the above.  However, as I havnt got a clue what I'm doing with PHP etc I have no idea if the stuff I'm finding is relevant / what I need to do.

As the problem has only surfaced after server changes I've just contacted the host with the above info & will see what they say.  In anticipation of their reply not being particularly useful might I trouble you to point me in the direction of instructions on how a PHP (complete!) newbie can recompile?

Rgds & many thanks
Richard

Tranz

Sorry, only your host can recompile PHP.

RJPotts

Quote from: TranzNDance on October 04, 2005, 05:16:54 PM
Sorry, only your host can recompile PHP.

Ah, ok, it's probably quite good that I cant meddle with it :)

They were actually quite useful and have recompiled PHP with 'freetype' support, while the original error msg has cleared I now get another one when I try to add watermarks "Warning: imagettftext(): Could not find/open font in /home/cameyinf/public_html/gallery/include/picmgmt.inc.php on line 356".  That line points to 'home/cameyinf/public_html/arial.ttf' (as it always did) and the font is still where it previously was.

I've just emailed the hosting company again but in the meantime, do any of the experts here know of a fix I can make?

Rgds & many thanks
Richard

Stramm

check if that's really the absolute path. After a reconfig things may have changed. When it was before /home... it may be now /usr/home...
Open a ssh session cd to your fontfile and type pwd. This will spitz out the path... now that you're already there, check permissions (and owners) and change permissions if necessary

vincenzo_hk

Every day I need to update 1000 pics in some of the albums, Is it possible only watermark the New Pics? not run the Whole albums files once again!

Thanks

TheGamer1701

Hello,

this is really a great mod, but I'm missing a little feature here:

I don't want to watermark private albums.
So, how can I modify this hack?

Any idea?
I tried it with the picmgmt.php file with the first entry, but that did not work.
If you could give me a hint to the right location in the code, I guess I can do this on my own then..

Thx,
André

nytemare

I am having a problem with the MOD, i installed it and it sorta worked fine, had no problems and got it to watermark pictures. However, i noticed that it didn't watermark everything, a few files were missed out. Here's a link to an album which i tried to watermark http://www.azngirls.net/gallery/thumbnails.php?album=7 You will find that the original pictures, which are the bigger ones would have been watermarked where as the smaller sized pictures (not the small thumbnails) which you click on to see the larger image does not get watermarked.

Has anyone else come across similar problems?

nytemare

Another thing just happened.. check out the first 2 thumbnails or rather in all of the thumbnails you can see my watermark, but in a previous album i watermarked, the thumbnails didn't get affected. And what's weird is that some of the thumbnails have the watermark when you click and see the normal resized image it doesn't show a watermark.. and when you view the original picture than you can see a watermark again. It's all so confusing.