Log in

View Full Version : Watermark images (on upload)


Robbban
08-16-2004, 10:00 PM
Here is an improved version of Watermark. Saves a lot of serverload on big sites like mine (since it's an adult site I won't paste the URL here. Send me an PM if you would like to know).

Currently only works if you have thumbnail creation enabled.

*** All that plan to install this modifcation are advised to read the posts in this thread prior to installation (vB.org Staff) ***

Johnny
08-17-2004, 02:39 PM
been waiting a few days but thx and great hack im gonna go test it now.

kingady
08-17-2004, 02:50 PM
my forum doesnt have function/ folder or the file www.hl2insider.net latest vb

Johnny
08-17-2004, 02:53 PM
i belieave me meant to type includes folder instead of function folder

kingady
08-17-2004, 03:02 PM
okay, done it all, i dont see my logo in my attachments

kingady
08-17-2004, 03:04 PM
else if (!empty($thumbnail['filedata']))
{
// write out thumbnail now
$filename = fetch_attachment_path($posterid, $attachmentid, true);
$fp = fopen($filename, 'wb');
fwrite($fp, $thumbnail['filedata']);
fclose($fp);
unset($thumbnail);
/* WATERMARK by Robbban*/
$wmark = "http://www.hl2insider.net/forums/watermark.png";

$im = imagecreatefromjpeg(fetch_attachment_path($posteri d, $attachmentid));
imagealphablending($im, true);

$watermark = imagecreatefrompng($wmark);

$y = imagesy($im) - imagesy($watermark);

$w = imagesx($watermark);
$h = imagesy($watermark);

imagecopy($im, $watermark, 0, $y, 0, 0, $w, $h);
imagejpeg($im, fetch_attachment_path($posterid, $attachmentid), 100);
}
}


correct?

kingady
08-17-2004, 03:38 PM
someone reply :9

Johnny
08-17-2004, 03:51 PM
the watermark will only appear if only u upload a new image.. have u done that. all other uploaded images already on the site wont have a watermark

kingady
08-17-2004, 03:53 PM
yes, i uploaded 4 new images, didnt work, visit my forum and try for yourself =0

ranger2kxlt
08-17-2004, 07:26 PM
How about for 3.0.0?

none of this is in my functions_file

// write out thumbnail now
$filename = fetch_attachment_path($posterid, $attachmentid, true);
$fp = fopen($filename, 'wb');
fwrite($fp, $thumbnail['filedata']);
fclose($fp);
unset($thumbnail);

Johnny
08-17-2004, 07:30 PM
currently it only works for 3.0.3 so u will need to upgrade ur board for this hack to work.

kingady
08-17-2004, 09:27 PM
doesnt work at all tbh, unless you can set it up for me?

Skyline_GT
08-18-2004, 06:10 AM
I sue vb 3.0.3 but still doesn't work..

Robbban
08-18-2004, 06:57 AM
Oh yeha, this hack only works if you have thumbnails enabled witch I hope you have :)

N8R
08-18-2004, 07:40 AM
I am getting nothing, and I have done everything and have met all the requirements, I must be missing something, but I have no idea what?

kingady
08-18-2004, 12:50 PM
okay enabled it, see no difference at ALL!

Johnny
08-18-2004, 12:53 PM
Oh yeha, this hack only works if you have thumbnails enabled witch I hope you have :)


is their a way around without using thumbnails?

Ming Keong
08-19-2004, 01:38 AM
Doesn't work for me either. I'm on 3.0.3 and have thumbnails enabled.

HostBet
09-08-2004, 11:49 PM
is not working here either .....

Johnny
09-09-2004, 12:17 AM
pretty much sad, someone creates something but fails to give support eventhough it works for no one except the person that created it

pagekeeper
09-09-2004, 02:49 AM
yeh i could of sworn i've seen this hack already, but it was really slow or something ?

Johnny
09-09-2004, 02:52 AM
theirs another hack just the other attachment watermark hack will add watermark to all the attachments you have without uploading which causes the server to load the images slow.

https://vborg.vbsupport.ru/showthread.php?t=68112

that works fine just loading time of the images is horrible just too bad this new version dont work atall

pagekeeper
09-09-2004, 02:54 AM
yeh, we should protest ... but hey it aint going to change anything so i'll shut up :D

Idodo
09-12-2004, 06:10 AM
can you make a version that work for ppl that don't have thumbnails enabled?

Blam Forumz
09-12-2004, 06:47 AM
vB 3.0.2 here and it doesnt work

Johnny
09-12-2004, 12:43 PM
vB 3.0.2 here and it doesnt work

because the title says clearly that its for 3.0.3

Blam Forumz
09-12-2004, 04:30 PM
Ah! I got it to work.

Fear me

Johnny
09-12-2004, 05:03 PM
Ah! I got it to work.

Fear me

im afraid, how did u get it to work

Blam Forumz
09-12-2004, 06:30 PM
I have no clue lol, it just started working o_Omaybe becuase i used the watermark (on the fly) hack

jcbn1981
10-01-2004, 03:37 AM
has anyone really gotten this thing to work? If so please help.

AlexanderT
10-01-2004, 07:34 AM
How is this a "major addition" anyway?

PAINTBALLM
10-21-2004, 02:07 AM
blah.. the hack author fails to respond? lol

dude, your hack sucks. Both of them.

PAINTBALLM
10-21-2004, 02:17 AM
actually, im sorry I take that back. I have your on-the-fly hack working great, and fast ;)

lange
11-09-2004, 09:54 AM
Give it a try. Thx

Bandolero
11-20-2004, 11:14 PM
PAINTBALL can you please tell us how did you get this hack to work.

I keep getting images cut-off OR extremelly slow depending on the compression level of imagejpg().

I'm new at PHP but it seems either something I need to do in the Graphics library or maybe the watermark.png needs to be of a different type.

OR

Maybe this code should not be here and be placed somewhere else, somehow else.

Thanks.

PAINTBALLM
11-21-2004, 12:10 AM
Well, it cuts off on some images for me. I think a quick solution would be to add an inch or so below the content in the png file. That away at most it would be flush with the bottom of the image, if not then it would be a little higher than the bottom but no big deal.

Bandolero
11-21-2004, 06:57 AM
Well, it cuts off on some images for me.
Ok so you have not gotten it to work 100%. Would this ever work?

Do they remove or otherwise flag hacks that do NOT work?
So that we can get other people to help us try.

I did a search on "watermarks" and all they links send you to this thread. This thread should be flagged as "don't waste your time" or "under construction"

oh well...

Johnny
11-21-2004, 01:41 PM
actually this code really works, i tested the code out by making the watermark hack act like a regular php script file (no vb involved) and then ran it with any jpg, or jpeg image i can find and it worked. but when it comes to intergrating with vb on why it doesnt work correclty i still cant figure that one out. but what im thinking their is one or two more codes missing in the coding for this hack to work in vb or the creator just isnt telling us something on how to get it to work correctly.

PennylessZ28
11-22-2004, 03:02 PM
I got this message when I upload images now

Warning: Missing argument 2 for fetch_thumbnail_from_image() in /disk3/home2/web/beginner/fbody/includes/functions_image.php on line 87

PennylessZ28
11-22-2004, 03:07 PM
Great, now when I upload anything it goes to a blank page. Sigh.

Splatt_XP
12-27-2004, 01:00 PM
I just stumbled on this hack, seeing it doesn't work.

Searching the ImageMagick site shows multple command line ways of watermarking.

Question: couldn't it just be accomplished by something like this:

shell_exec('composite -gravity SouthEast -compose plus ' . $watermark_image . ' ' . $original_image . ' ' . $destination_image);


If so, where would you put that command?

yoyoyoyo
01-21-2005, 03:36 AM
this hack works fine in 3.0.5 and 3.0.6 (just make sure you have a transparent .png file)

T3MEDIA
01-27-2005, 12:42 PM
this hack works fine in 3.0.5 and 3.0.6 (just make sure you have a transparent .png file)
Yo Yo are you sure? Your the only one that says it works.
Vb.org sucks man. They tell you to come here to do almost anything besides how to use a if statement and they dont monitor the dam posts.

I should put up a hack that erases your database and put major addition and hack of the month. maybe then they will do something....
jeez. Or maybe its just cuz im moody today. LOL

yoyoyoyo
01-27-2005, 02:35 PM
Yo Yo are you sure? Your the only one that says it works.
Vb.org sucks man. They tell you to come here to do almost anything besides how to use a if statement and they dont monitor the dam posts.

I should put up a hack that erases your database and put major addition and hack of the month. maybe then they will do something....
jeez. Or maybe its just cuz im moody today. LOL
positive. but you need to have "create thumbnail" turned on and have the right kind of transparent img file as mentioned earlier in the thread. works 100% for me!

steadicamop
02-03-2005, 06:37 AM
I have Create Thumbnail enabled, but I only ever had about a quarter of the picture load, when you refresh, you get a shed load of text (just random characters) ... this is a great hack and something I really could do with having on my forum!!

Thanx guys

majgik
02-20-2005, 10:26 PM
i have thumbnails enabled and it doesnt work

Bulleh
03-01-2005, 11:02 PM
It works on some images for me but not others...

salem65
03-07-2005, 09:33 PM
The filesize of the image gets set in the dbase before the watermark is put on. So the image is actually larger. Then in the attachment.php it has header("Content-Length: $filesize"); Well it is only going to read out the amount of the file that is set in the dbase. Comment this line or get the filesize from the actual attachment and it works.

msimplay
03-19-2005, 05:35 PM
does this hack watermark on the fly like photopost ?

tanyeri24
04-12-2005, 04:07 PM
no it's dont work..

ford351coupe
07-25-2005, 05:15 AM
is it possible to change this so it watermarks the images on upload without the need to thumbnail being set? I have someone wanting to watermark the images, but doesn't want to thumbnail them, and watermarking on the fly isn't working out for the users.

Denno
07-28-2005, 02:20 PM
Does this also work with 3.0.7?

Feckie (Roger)
07-28-2005, 04:01 PM
Does this also work with 3.0.7?

Yep i had the same result

Denno
07-28-2005, 05:37 PM
Ok cool ++++. Will try this out now then.

Denno
07-28-2005, 06:17 PM
Hmm does not seem to work...maby I got the path wrong..nothing happens.

Denno
08-04-2005, 10:34 AM
Any ideas?

SilentNoise
08-12-2005, 09:01 AM
Hmm does not seem to work...maby I got the path wrong..nothing happens.

I've got the right path and everything, and I'm running v3.0.8, but getting nothing

FightRice.com
08-17-2005, 04:51 AM
I always got nothing everytime i tried this too

Bandolero
08-18-2005, 10:00 AM
And here is why:

vBulleting loads the original image and keeps a record of the original size in bytes.
After a stamp is added to an image its filesize increases.
vBulleting will only deliver the original number of bytes to the browser.
This causes the browser to NOT display a section at the bottom of the image.

I'm sure there is a way to fix this size problem somewhere in the PHP code or settings, but it became too deep for my resources.

Bk-LS
09-09-2005, 05:27 AM
this works fine for jpg so far but I get errors with gifs. The gif uploads, but has the following error message with no watermark on the image. How can I code this watermark hack around gifs? or just to skip gifs?

Warning: imagecreatefromjpeg(): gd-jpeg: JPEG library reports unrecoverable error: in /includes/functions_file.php on line 567

Warning: imagecreatefromjpeg(): '/home/domain/my_domain_name.com/VBULL_ATTACH/3/3418.attach' is not a valid JPEG file in /includes/functions_file.php on line 567

Warning: imagealphablending(): supplied argument is not a valid Image resource in /includes/functions_file.php on line 568

Warning: imagesy(): supplied argument is not a valid Image resource in /includes/functions_file.php on line 572

Warning: imagecopy(): supplied argument is not a valid Image resource in /includes/functions_file.php on line 577

Warning: imagejpeg(): supplied argument is not a valid Image resource in /includes/functions_file.php on line 578

honguyen
10-24-2005, 03:29 PM
the error i got, when viewing the original large image is only half, the bottom half of image got blank out all white, anyone got this working fine /

PowerStroke
11-19-2005, 06:35 PM
Did anybody get this to work? If so... please post the proper code and instructions. I am in need of a good watermark hack. I have another site that is stealing our images and I can't always keep doing the watermark manually. I could care less about the watermark resizing.

Anybody? :eek:

croportal
12-24-2005, 09:09 AM
anyone know hot to do that in 3.5.0 version

Brandon Sheley
01-16-2006, 11:43 PM
anyone know hot to do that in 3.5.0 version


ditto :squareeyed:

Robru
01-24-2006, 01:37 PM
Please, Can someone port this to 3.5.x ?

PabloAM
03-07-2006, 01:00 PM
Please, Can someone port this to 3.5.x ?

Who port this hack, He will be the Hackero of the year 2006, and his hack XD

saree
03-29-2006, 10:17 PM
Who port this hack, He will be the Hackero of the year 2006, and his hack XD

yes i agree