Permanent Watermark with GD2 - Page 7 Permanent Watermark with GD2 - Page 7
 

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

Permanent Watermark with GD2

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

Previous topic - Next topic

0 Members and 5 Guests are viewing this topic.

Nibbler

You should be able to use the is_image() function to check if the file is an image, and only apply the watermark if it is.

lanun

Hi. I've applied this hack to all of the instructions but I get the following error when I do the watermark action.

Fatal error: Unsupported operand types in /home/badak/public_html/mrbadak/include/picmgmt.inc.php on line 320

the line 320
$src_x = $srcWidth - ($logoW + 5);

is this problem with my server settings? how do i check?

melbcentral

Hey i tried it before and it worked very good on my site. And I have changed my hosting recently and they dont support file .png and i made the change it to .jpg and .gif but i showed some error

Warning: imagecreatefrompng(/home/httpd/vhosts/vietfanclub.com/httpdocs/gallery/images/newlogo.jpg): failed to open stream: No such file or directory in /home/fanclub/public_html/gallery/include/picmgmt.inc.php on line 304

Warning: imagesx(): supplied argument is not a valid Image resource in /home/fanclub/public_html/gallery/include/picmgmt.inc.php on line 305

Warning: imagesy(): supplied argument is not a valid Image resource in /home/fanclub/public_html/gallery/include/picmgmt.inc.php on line 306

Warning: imagecopy(): supplied argument is not a valid Image resource in /home/fanclub/public_html/gallery/include/picmgmt.inc.php on line 323


any ideas >???


foulu

path of your server has changed, change it to right value

KlausH

Quote from: Burpee on June 20, 2004, 11:43:25 PM
I was unable to modify my original post and I do think that the top post should be the newest version. So I suggest you either split this post off or move it to the first somehow.

I decided to "modify" this mod so it'll work in CPG 1.3 and my brother helped me fix the "_normal" bug


Just installed and works perfectly in CPG 132!

Thanks for this nice stuff!

Greetings

Klaus

TheGamer1701

Hey,


I applied the hack to my page http://www.partynation.tv/ in the gallery and it works great.
BUT, unfortunetly, I can't make it work to use a transparent image...
Even if I save my png file as a transparent, it won't use it as a transparent watermark...

see the examples (I tried a few different files) in this album:
http://www.partynation.tv/coppermine/thumbnails.php?album=52
(First 4 pictures)

I use IrfanView to modify my pictures... The png file IS transparent.. I tested it with a basic html file and it works.
I attached the picture...


I really hope that someone of you can help me.
I'm not a great graphic guy... :D

(nor is my english really good, sorry)


Thx,
André

TheGamer1701


kegobeer

If you are using Internet Explorer, you are out of luck.  IE doesn't display transparent PNG images correctly.  There's an IE PNG fix available on the web - http://koivi.com/ie-png-transparency/
Do not send me a private message unless I ask for one.  Make your post public so everyone can benefit.

There are no stupid questions
But there are a LOT of inquisitive idiots

TheGamer1701

well, I'm using mozilla firefox...

and actually IE DOES display the transparent png ...
but when I try to watermark my pictures with this png, I don't get an transparent logo...
everything that's meant to be transparent appears white...


any solution?

Burpee

Perhaps something is wrong with the way IrfanView processes transparency? I'll attach an image exported in PSP8, try it with that.

kegobeer

Something is up, because IE does not handle PNG-24 alpha transparency correctly.  Unless of course your images are PNG-8 with binary transparency, which IE does handle properly.

Go here and see how a PNG-24 image displays with and without the PHP fix.

This could be an issue with the type of PNG image you are trying to superimpose.  Try both PNG-8 and PNG-24 and see if either one of them displays correctly when applied as a watermark.
Do not send me a private message unless I ask for one.  Make your post public so everyone can benefit.

There are no stupid questions
But there are a LOT of inquisitive idiots

Burpee

Kegobeer, the images are applied on the server on upload. I don't think this is an issue with IE, I think it's an issue with GD2 not properly reading and applying the file.

kegobeer

Yeah, I'm sure you're correct, Burpee.  Perhaps an older version?
Do not send me a private message unless I ask for one.  Make your post public so everyone can benefit.

There are no stupid questions
But there are a LOT of inquisitive idiots

Burpee

I somewhat doubt it, GD2 doesn't change that much for as far as I know. However, the file that he attached was somewhat big in size for an image that small. If you look closely, you'll see that the image I attached is only half that size. Hopefully that will fix it for him.

Stramm

hey, that's a great mod... however there are two things I didn't like
1. no transparency for the watermark
2. it's a final step... you can't undo the watermarking

so I made a mod of the mod. You can set transparency for the watermark and you can redo watermarking. Means you can totally get rid of it, or if you just want to have another watermark.. no problem at all. Other spot on the image... not a problem at all.

So if one of you guys is interested I'd put it up here... or is it wrong to put it in that thread???

Tranz

Please create a new thread in a board that you can post. A moderator will move accordingly.

Stramm

OK, it's in support-1.3-misc
hope you like it

TheGamer1701

Hey Burpee, I just fell in Love with you :-)


That image works perfectly, thank you very much.

Do you know where the error was?
thx

Burpee

No problem :)

I think the error was that IrfanView was not producing the right kind of PNG, messing up the alpha layer.

mr_summoner

Warning: imagecreatefrompng(): open_basedir restriction in effect. File(/PG/watermark.png) is not within the allowed path(s):

hi..
this is my  first post here. i got the above error...i think it is about "Which file to use for watermark "..
i just dont know how to insert the correct path for my watermark image.
this is my link to my watermark image... http://ftsmania.com/PG/watermark.png
my coppermine is in the PG folder.... anyone please help me...