PDA

View Full Version : Add-On Releases - Attached Image Watermarking PLUS Guest Viewing of Thumbnails


ConqSoft
03-11-2007, 10:00 PM
I had been looking for these two options for quite a while, and was finally able to hire Brian (of vBadvanced (http://www.vbadvanced.com/)) to write them for me. Since a lot of people have been looking for this, I have decided (with Brian's permission) to release this as a free, unsupported, modification.

This modification will allow you to specify a watermark image that will be overlayed over any attached JPG or PNG file on your site in real time, as the image is displayed. NO PERMANENT CHANGES ARE MADE TO ANY OF YOUR ATTACHMENTS. You can also exclude specific forums and usergroups from seeing the watermark.

As an added bonus, he included the ability to allow guests to see attached image thumbnails, while still requiring them to register to see the full size attachments. (Make sure you have your Unregistered / Not Logged In usergroup set to NOT have access to download attachments.)

PLEASE CLICK INSTALL so that maybe Jelsoft will include these as built-in features in a future version.

Notes/Troubleshooting:

Your server needs to have GD2 installed.
Attachments must be stored in the file system. Database storage of file attachments will not work.
Make sure you use the full PHYSICAL path to your watermark image.
Make sure you have a low number in the width/height setting. (I use 200, since my watermark image is 150 pixels wide.)
If you have previously viewed the attached image, your browser may cache it, so you will need to clear your browser cache or force a hard refresh (CTRL-F5) while viewing the image to get the new watermarked version.



Well, on to the modification:

=============================================
STEP 1:
Since the resulting file contains too much vBulletin code, I am unable to include it with this modification. So, the first step is to copy vBulletin's attachment.php to a file named attachment_watermark.php. Then, edit attachment_watermark.php, making the following changes.

=============================================
STEP 2:
You need to delete a LOT of lines from the top of the file. Find this line...

$idname = $vbphrase['attachment'];


...and delete everything ABOVE it other than the <?php line at the top of the file.

Your attachment_watermark.php file should begin with this code when you've completed this step:

<?php
$idname = $vbphrase['attachment'];



=============================================
STEP 3:
Find this line of code:

if (!($forumperms & $vbulletin->bf_ugp_forumpermissions['canview']) OR !($forumperms & $vbulletin->bf_ugp_forumpermissions['canviewthreads']) OR !($forumperms & $vbulletin->bf_ugp_forumpermissions['cangetattachment']) OR (!($forumperms & $vbulletin->bf_ugp_forumpermissions['canviewothers']) AND ($attachmentinfo['postuserid'] != $vbulletin->userinfo['userid'] OR $vbulletin->userinfo['userid'] == 0)))


REPLACE with this code:

if (!($forumperms & $vbulletin->bf_ugp_forumpermissions['canview']) OR !($forumperms & $vbulletin->bf_ugp_forumpermissions['canviewthreads']) OR (!($forumperms & $vbulletin->bf_ugp_forumpermissions['cangetattachment']) AND !$vbulletin->GPC['thumb']) OR (!($forumperms & $vbulletin->bf_ugp_forumpermissions['canviewothers']) AND ($attachmentinfo['postuserid'] != $vbulletin->userinfo['userid'] OR $vbulletin->userinfo['userid'] == 0)))



=============================================
STEP 4:
Find these lines of code:

else
{
$attachpath = fetch_attachment_path($attachmentinfo['userid'], $attachmentinfo['attachmentid']);


Add this code BELOW the lines referenced above:

// #########################################
// ##### Start modified section for watermarks
// #########################################

$vbulletin->options['attach_water_exforums'] = explode(',', $vbulletin->options['attach_water_exforums']);
$vbulletin->options['attach_water_exgroups'] = explode(',', $vbulletin->options['attach_water_exgroups']);


if ($vbulletin->options['attach_water_filelocation']
AND in_array($extension, array('jpg', 'jpeg', 'png'))
AND !in_array($attachmentinfo['forumid'], $vbulletin->options['attach_water_exforums'])
AND !array_intersect(fetch_membergroupids_array($vbull etin->userinfo), $vbulletin->options['attach_water_exgroups'])
)
{
$attachsize = getimagesize($attachpath);

if ($attachsize[0] >= $vbulletin->options['attach_water_minsize'] AND $attachsize[1] >= $vbulletin->options['attach_water_minsize'])
{
$waterimage =& $vbulletin->options['attach_water_filelocation'];
$watersize = getimagesize($waterimage);

$waterext = strtolower(substr($waterimage, strrpos($waterimage, '.') + 1));

// Coordinates (height)
switch ($vbulletin->options['attach_water_coordinates'][0])
{
case 'n':
$waterpos['height'] = 0 + $vbulletin->options['attach_water_padding'];
break;
case 'm':
$waterpos['height'] = round(($attachsize[1] - $watersize[1]) / 2);
break;
case 's':
$waterpos['height'] = round(($attachsize[1] - $watersize[1])) - $vbulletin->options['attach_water_padding'];
break;
}

// Coordinates (width)
switch ($vbulletin->options['attach_water_coordinates'][1])
{
case 'w':
$waterpos['width'] = 0 + $vbulletin->options['attach_water_padding'];
break;
case 'c':
$waterpos['width'] = round(($attachsize[0] - $watersize[0]) / 2);
break;
case 'e':
$waterpos['width'] = round(($attachsize[0] - $watersize[0])) - $vbulletin->options['attach_water_padding'];
break;
}

// Watermark ext
switch ($waterext)
{
case 'jpg':
case 'jpeg':
$watermark = imagecreatefromjpeg($waterimage);
break;

case 'png':
$watermark = imagecreatefrompng($waterimage);
break;
}

// Attachment ext
switch ($extension)
{
case 'jpg':
case 'jpeg':
$attachimage = imagecreatefromjpeg($attachpath);
break;

case 'png':
$attachimage = imagecreatefrompng($attachpath);
break;
}

imagealphablending($attachimage, true);

$watermark_width = imagesx($watermark);
$watermark_height = imagesy($watermark);

imagecopy($attachimage, $watermark, $waterpos['width'], $waterpos['height'], 0, 0, $watersize[0], $watersize[1]);
define('WATERMARKED', true);
}
}
// #########################################
// ##### End modified section for watermarks
// #########################################



=============================================
STEP 5:
Find this line of code:

header('Content-Length: ' . (($lastbyte + 1) - $startbyte));


REPLACE with this code:

// #########################################
// ##### Start modified section for watermarks
// ##### Changed to prevent filesize header on watermarked images
// #########################################
if (!defined('WATERMARKED'))
{
header('Content-Length: ' . (($lastbyte + 1) - $startbyte));
}
// #########################################
// ##### End modified section for watermarks
// #########################################



=============================================
STEP 6:
Find this line of code:

($hook = vBulletinHook::fetch_hook('attachment_display')) ? eval($hook) : false;


REPLACE with this code:

// #########################################
// ##### Start modified section for watermarks
// #########################################
if (!$vbulletin->GPC['thumb'] AND defined('WATERMARKED'))
{
imagejpeg($attachimage);
imagedestroy($attachimage);
imagedestroy($watermark);
}
// #########################################
// ##### End modified section for watermarks


=============================================
STEP 7:
Find this line of code:

($hook = vBulletinHook::fetch_hook('attachment_complete')) ? eval($hook) : false;


REPLACE with this code:

exit;



=============================================
STEP 8:
Save and upload attachment_watermark.php to your forum root directory.


=============================================
STEP 9:
Install the product-attach_watermark.xml Product via the vBulletin AdminCP Product Manager.


=============================================
STEP 10:
Configure the options at AdminCP -> vBulletin Options -> Attachment Watermarks. All fields should be self-explanatory.

nexialys
03-12-2007, 08:34 PM
kinda cool, i think i will tweak on it.. ;)

Kanustep
03-12-2007, 08:41 PM
Sound interesting, thank you ConqSoft.

FleaBag
03-12-2007, 08:44 PM
A fantastic tool to drive registration on 2 fronts. Very kind of you to release it, thanks.

PKRWUD
03-12-2007, 09:02 PM
I installed it, but it's not showing up. Does the watermark itself have to be a .jpg or .png file? I used a .gif file.

*edit*

I tried it with a .png file, and still no luck.

ConqSoft
03-12-2007, 09:10 PM
A transparent .PNG is the best thing to use for the watermark.

Gryphon
03-12-2007, 09:11 PM
jpg or png for watermark. However, I can't get it to work either.

ConqSoft
03-12-2007, 09:14 PM
Your server needs GD2 installed also. (Edited above.)

It's possible that I made a mistake with the modification instructions. Since I just have the fully modified file, I had to build the change instructions from that. I'll look over it and see if I missed anything. It would be much easier to just include the file, but it may violate site policy since it contains a lot of original vBulletin code.

ConqSoft
03-12-2007, 09:20 PM
Ok, I found two errors. Please re-do steps 5 and 6.

Ntfu2
03-12-2007, 09:32 PM
Conq if this works, and you ever want to have kids, i'll have them for you :D

ConqSoft
03-12-2007, 09:43 PM
Conq if this works, and you ever want to have kids, i'll have them for you :D

Let me know. Still need to make sure I don't have any other mistakes in the file editing instructions above. It's working fine on 3 of my sites, and one other site.

Gryphon
03-12-2007, 09:52 PM
Still haven't been able to get it working, have edited completely twice.

GD 2.0.28

Step 5 contains an extra brace at the end of the find string, not that it matters much.

ConqSoft
03-12-2007, 09:54 PM
Are you using the full PHYSICAL path to the watermark file, and do you have the width/height setting set to something low enough to affect your images, and are your attachments stored in the file system?

Also, if you have viewed the attachment previously, it may be cached. Make sure you clear your browser cache.

Gryphon
03-12-2007, 10:01 PM
Ah, I didn't realize they had to be stored as files. I thought I had seen a specification on the request to use the database.

I am sure all is correct, I have written my own watermarking previously, however it is a project outside of vBulletin and uses ImageMagick.

ConqSoft
03-12-2007, 10:01 PM
Step 5 contains an extra brace at the end of the find string, not that it matters much.

Fixed, thanks. It would make a difference, if you replaced the brace too. ;)

ConqSoft
03-12-2007, 10:02 PM
Ah, I didn't realize they had to be stored as files. I thought I had seen a specification on the request to use the database.

I am sure all is correct, I have written my own watermarking previously, however it is outside of vBulletin and uses ImageMagick.

Well, I haven't tested it with attachments in the database, because I don't have any sites that use that method. I much prefer to store them in the file system. So, that could be the issue.

ConqSoft
03-12-2007, 10:15 PM
If anyone gets this working, please reply so that I know the instructions are correct. Thanks.

ZomgStuff
03-12-2007, 10:32 PM
Wow, thanks!

PKRWUD
03-12-2007, 11:53 PM
I redid the necessary steps, and double checked everything, and it's all done as required, and still no luck, however my attachments are not stored as files. I'm guessing that must be the problem I'm having.

Lionel
03-13-2007, 01:56 AM
I just downloaded and am praying that it works with database attachments. Anyway, that was very nice of you to share this much needed feature.

Lionel
03-13-2007, 03:16 AM
Unfortunately, it did not work for me with attachments in database.

funkmeister
03-13-2007, 04:49 AM
If anyone gets this working, please reply so that I know the instructions are correct. Thanks.Hi - it worked first time for me - many thanks, as I have been looking for this feature for a very long time - much appreciate the effort of all involved.

ninjamaster
03-13-2007, 07:47 AM
thanks for this it looks good :)

milsirhc
03-13-2007, 09:46 AM
many thanks for this mod! been looking for it a long time!

before i start implementing it, does this work with the highslide attachment mod?

Jelmertjee
03-13-2007, 11:09 AM
thanks very much, although some users seem to have trouble with getting this to work I had no problems at all.
(i'm using filesystem attachments, which is better anyway..)

MrNase
03-13-2007, 12:26 PM
Should the original attachment.php stay or can we delete it?

ConqSoft
03-13-2007, 12:55 PM
It needs to stay also. This is just a new file that uses a lot of code from attachment.php because they're weren't enough hooks to do everything he needed to do.

Lionel
03-13-2007, 01:23 PM
So far it's seems to be only 2 of us with problems. Has someone managed to use with attachments in database?

ConqSoft
03-13-2007, 01:30 PM
So far it's seems to be only 2 of us with problems. Has someone managed to use with attachments in database?

No, it does not work with attachments in the database. This has been confirmed, and I updated the modification instructions at the top.

Bulent Tekcan
03-13-2007, 09:43 PM
Is this plugin works with .gif extension ?

Thanks

ConqSoft
03-13-2007, 09:46 PM
Is this plugin works with .gif extension ?

Thanks

Not currently, though it should be pretty easy to add that to the IF statement, CASE statement, and use the PHP imagecreatefromgif() function I would think.

Bulent Tekcan
03-13-2007, 10:50 PM
Not currently, though it should be pretty easy to add that to the IF statement, CASE statement, and use the PHP imagecreatefromgif() function I would think.


I'm already add .gif extension,and works fine on my test boards.I'll hard test on my test forum 2-3 days then apply production forum.

Thanks

project-Buckfas
03-14-2007, 11:46 AM
Thanks ConqSoft

I've wanted this for a whlle now!

Karabaja
03-14-2007, 04:12 PM
Thanks for sharing this. I'll give it a go as soon as I get a chance.

sensimilla
03-14-2007, 08:18 PM
sorry its ok...

Thanks for the nice hack!

goblues
03-14-2007, 09:03 PM
Right on! I have been following your request for this. Thanks for sharing!

Kahuna900
03-14-2007, 09:26 PM
Thanks Keith,

Instructions were perfect and everyting is working great on all my forums.

benjaminkramer
03-15-2007, 05:09 PM
Thanks for your Plugin.

I want that a guest can view the thumbnails but not the full full size oft it.
But it does not work.

My stettings:
Guests to View Thumbnails yes
Unregistered / Not Logged In usergroup set to NOT have access to download attachments

ConqSoft
03-15-2007, 05:41 PM
Did you follow all the steps? The attachment_watermark.php file is still required for the Guest Thumbnail feature also. Though, you can just leave the watermark fields empty if you don't want to use that part.

benjaminkramer
03-15-2007, 05:45 PM
yes I did
here is my attachment_watermark.php

ConqSoft
03-15-2007, 05:48 PM
You shouldn't attach that because it contains too much vBulletin code.

But, double check everything because it's working fine for others. It could also be a conflict with some other mod you have installed.

Ntfu2
03-16-2007, 05:51 PM
When this is enabled some thumbnail images become broken? When disbaled, they all work just fine. Any idea?

ConqSoft
03-16-2007, 05:53 PM
No idea... Do you have any other attachment/thumbnail related hacks running that may conflict?

Sychev_S
03-16-2007, 09:55 PM
Thank you, Works like a charm!

Pottsy
03-17-2007, 11:57 AM
This mod is great - thank you for sharing!

One issue (and I think it's me being thick or just the way vB works) - I display images in line to registered users (no pesky thumbnails). If I want to show thumbs to unregistered users, I need to turn on thumbnails (and build them), but there seems to be no way to now let registered users to view in line.

So, can I show thumbs to unregistered users but still show full images inline to registered users?

ConqSoft
03-17-2007, 12:38 PM
Not without some additional hacking/mods....

Pottsy
03-19-2007, 10:13 AM
Thanks - was just checking I understood it correctly.

One more thing - when the watermark is displayed (I'm using a transparent png) the overall quality of the displayed jpg goes down quite significantly. Is there any way around this?

voter
03-19-2007, 11:51 AM
yes I did
here is my attachment_watermark.php
I tested your attachment, works without problems.

Check if you really change your Attachment Storage Type into Filesystem

And the path to watermark image is correct in AdminCP -> vBulletin Options -> Attachment Watermarks

voter
03-19-2007, 01:50 PM
How about pictures putted via [ IMG ][ /IMG ] tags? Is there any way to put a watermark on them,too?

ConqSoft
03-19-2007, 01:55 PM
How about pictures putted via [ IMG ][ /IMG ] tags? Is there any way to put a watermark on them,too?

No, this works for attached images only. If the images are on other servers you don't have any control over them, so you can't.

( Plus, they aren't on your server anyway, so you don't really have the right to watermark them. :D )

daddygrim
03-19-2007, 03:00 PM
any luck??????

ConqSoft
03-19-2007, 03:01 PM
Any luck with what?

voter
03-22-2007, 10:38 AM
There is a conflict with Attachments in Private Messages
https://vborg.vbsupport.ru/showthread.php?p=1209483#post1209483

voter
03-22-2007, 10:42 AM
No, this works for attached images only. If the images are on other servers you don't have any control over them, so you can't.

( Plus, they aren't on your server anyway, so you don't really have the right to watermark them. :D )
Sure for copyright one have no right to put his watermark on pictures from other servers, but I was thinking to put on images in [ img ] tags something like "Originaly on (URL)" and as URL to use the original path to image - so that people differ which pictures are from local forum and which not.

bacanze
03-22-2007, 11:10 PM
Great idea, I will give it a go tomorrow, anyone got an example?

phill2003
03-24-2007, 03:35 PM
good stuff, Installed thanks very much.

casidom
03-24-2007, 10:55 PM
ConqSoft!

Why don't you attach your attachment_watermark.php file and share it with us? That would be great. I followed all your steps, but it seems like not working at all. My attachment thumb nails did not show up.

And some more question for you, what is "The full physical path to the image you wish to use for your watermark."? Where do I find it? Does it look like "/var/www/vhosts/...../images/watermark.png"?

Thank you.

ConqSoft
03-24-2007, 11:08 PM
As I noted on the hack at the top, I can*t attach the file because it contains too much vBulletin code.

Yes, that would be the full physical path.

milsirhc
03-24-2007, 11:08 PM
Yup! If you can kindly attached the attachment_watermark.php, that would be fantasticcccc!!

casidom
03-25-2007, 12:35 AM
Dear ConqSoft!

First of all I'd like to thank you for your quickly answer my question. Second of all, I'd like you to complete your steps in your first post because when I read all messeges in this thread, you and people have changed a lot of stuff in it. Like in secod page you said re-do step 5 and 6, I did and it still doesn't work. So, can you please post your final steps so we can follow it and make it work.

Thank you for you help.

By the way, your websites are really impresive!

ConqSoft
03-25-2007, 12:47 AM
Everything as posted works fine. There was a problem very early on, but it was corrected and many people (30+) have installed it since then without issues. Make sure your site meets the requirements listed (GD2 installed, attachments stored in the file system, full physical path specified to your watermark, etc) and it should work fine.

But, as this is an unsupported hack, that's about all the help I can offer.

Thanks

casidom
03-25-2007, 01:09 AM
ConqSoft!

My site has all the requirements listed. I tried to follow all your steps again, but the thumb nails don't show up, my attachments don't show up. In page 3, I saw benjaminkramer has attached his attachment_water.php file, I download it and try. Now, my thumb nails are showed up, but watermark is still not showed up. Please help.

ConqSoft
03-25-2007, 01:10 AM
It could also be a conflict with some other hack you have installed.

Sorry, I can't offer any additional help.

sensimilla
04-01-2007, 10:01 AM
Its working for me on all forums but not in vbadvanced modules, any ideas why ?

Thanks in advance!

rhinoForums.net
04-04-2007, 05:58 PM
Well, I was pretty excited about this mod but after running through the motions 3 times, my forum is still un-modded. I have added the new file (attachment_watermark.php), I have GD2 installed, I am using filesystem attachments (not database) and I have specified the full path to my transparent .png. Unfortunately my board acts the same as it did before. Nothing broke, but nothing changed either.

Thanks for the help and thanks a ton for posting this mod. I appreciate the help and hopefully will figure out what is causing my problems. If I do get it solved I'll let everyone know my problems/solutions.

Red Spider
04-04-2007, 08:14 PM
THANK YOU SOOOOOOOOOOOOOOOOO MUCH!!

I will make a donation on this :D

Red Spider
04-04-2007, 09:33 PM
Okay this doesnt work for me :(

My GD version is: GD Version bundled (2.0.28 compatible) & FreeType Version 2.1.9

but no image :(

EDIT:

image now works - but no watermark - i have the EXACT physical path set

Red Spider
04-05-2007, 06:46 PM
Fixed :)

Thanks for sharing :D

itsblack
04-05-2007, 08:40 PM
Actually I only need the "Guests view thumbnails" function, so I ripped it from the mod.
Anyway, thanks a lot for this useful mod. click "installed".

peterpigman
04-05-2007, 08:58 PM
Nice! Works well TYVM. Took a while to figure out how to do it but it is well worth it. Kudos for releasing it.

z0diac
04-06-2007, 11:41 AM
Great mother of god - I've been waiting for something like this since the day of my vB install.

QUESTION: Is there any way (or future plans) to have it add text BELOW the original image instead of a watermark directly over top of the image? I know my users would want my head on a pike if I covered up part of their photos with a watermark, no matter what the size of it....

taheri6
04-06-2007, 05:21 PM
Hello,

I am going to sound like a retard, but how to I verify if the attachments are in the filesystem? I checked in the ACP->options->Message attachment options - and I dont see where I can choose.

I have the mod installed, and everything looks the same as it did before I installed the mod, no difference.

ConqSoft
04-06-2007, 05:25 PM
AdminCP->Attachments->Attachment Storage Type

taheri6
04-06-2007, 05:44 PM
Doh, thanks!

I changed to the file system and now it works! YAY! Thanks for the mod, and for helping the retarded :)

Galt56
04-09-2007, 07:30 PM
Just wondering if anyone had seen errors like this:

Warning: getimagesize(/kunden/hompages/REST OF PATH TO IMAGE LISTED HERE) [function.getimagesize]: failed to open stream: No such file or directory in /attachment_watermark.php on line 97

Warning: imagecreatefrompng(/kunden/hompages/REST OF PATH TO IMAGE LISTED HERE) [function.imagecreatefrompng]: failed to open stream: No such file or directory in /attachment_watermark.php on line 138

Warning: imagesx(): supplied argument is not a valid Image resource in /attachment_watermark.php on line 157

Warning: imagesy(): supplied argument is not a valid Image resource in /attachment_watermark.php on line 158

Warning: imagecopy(): supplied argument is not a valid Image resource in /attachment_watermark.php on line 160

Warning: Cannot modify header information - headers already sent by (output started at /homepages/REST OF PATH TO IMAGE LISTED HERE/includes/class_core.php:3036) in /attachment_watermark.php on line 240

The error messages continue with other lines when you click on a thumbnail and try to view the full-sized image. The thumbnails are fine.

I have tried to edit the attachment.php file twice and followed all the steps. A transparent png file is being used for the watermark as the full path to the image from the server root (as determined by php info) is being used.

I have verified GD version 2+ and images are stored in a file system.

Thanks.

adrianus
04-19-2007, 09:52 AM
Made changes for gif and it works perfectly!

Thanks.

tekstylez
04-23-2007, 05:19 PM
is there anyway to watermark bbcode images?

Ntfu2
04-26-2007, 02:54 AM
finally got around to redoing the steps, and reuploading the product.

Everything works perfect again, thanks for the great mod!

bjhuang
04-26-2007, 03:20 PM
how to watermark hotlinked images only?

Ntfu2
04-26-2007, 03:21 PM
You can't watermark images that are not on your server.

Bulent Tekcan
04-27-2007, 04:51 AM
You can't watermark images that are not on your server.

How can I use watermark on our server without vBulletin attachment system.For example I need watermark ../testimages/ directory on my server.

Any idea for that ?

bjhuang
04-27-2007, 07:02 AM
i mean how to watermark only the attachments on my server that have been linked by other sites. i want to keep the images as it is when browsing by my members. but if the images were "stolen", i want them to be watermarked.

You can't watermark images that are not on your server.

bjhuang
04-27-2007, 11:05 AM
to support gif


[OPEN]
attachment_watermark.php

[FIND]
AND in_array($extension, array('jpg', 'jpeg', 'png'))

[REPLACE]
AND in_array($extension, array('jpg', 'jpeg', 'png', 'gif'))

[FIND]
$watermark = imagecreatefrompng($waterimage);

[ADD AFTER]
break;
case 'gif':
$watermark = imagecreatefromgif($waterimage);

[FIND]
$attachimage = imagecreatefrompng($attachpath);

[ADD AFTER]
break;
case 'gif':
$attachimage = imagecreatefromgif($attachpath);

datarecall
05-01-2007, 04:28 PM
worked excellent quick note to people that are trying this
dont use a transparent gif for your water mark you will get a bunch of errors
i put my watermark in the root directory because for some reason i got errors when putting it into images/watermark.png

thanks for the mod it works great.

Pottsy
05-19-2007, 04:13 PM
A while ago I posted about poor image quality with the watermark on.

I fixed this by finding this in attachment_watermark.php:

imagejpeg($attachimage);



and replacing it with this:

imagejpeg($attachimage,"",93);

The 93 is the quality of the output, with 100 as max and 50 as grotty.

HTH

ConqSoft
05-19-2007, 04:14 PM
Default quality is 75, and is usually fine.

Pottsy
05-20-2007, 12:01 PM
https://vborg.vbsupport.ru/external/2007/05/9.jpg

Those are a 1:1 crop of a detail of a pic uploaded and watermarked at the different quality levels. I saved this compilation at 100% quality to try to minimise the effects of another jpg conversion, but it shows the issue I was having. I was getting complaints... :)

ConqSoft
06-14-2007, 02:08 PM
I don't really see much of a difference between the 75 and the 93. *shrug*

Kahuna900
06-14-2007, 02:47 PM
I added he hack to allow watermarking of "gif" which worked, but it seems to mess with the transparency of the watermark.png file.

FleXy
06-17-2007, 04:05 PM
iexampled image isn't realy true color. try image with different colors like HG photo and you will see difference.

JDM-Spec
06-20-2007, 08:38 PM
if i upload my watermark logo called: water.png on my root folder , where is supposed to be the physical path to the image ?

1. /water.png ?
2. water.png ?

or ???

thanks

geevest.com
07-11-2007, 04:40 AM
i have a problem :

Parse error: syntax error, unexpected T_CASE in /home/website/public_html/forum/attachment_watermark.php on line 79

jasculs
07-11-2007, 06:19 PM
is there anyway I can get this so registered user can see the thumbnails, but not view the full image also...the guests can see the thumbnails and not view the full image, but the registered users just see a link they aren't allowed to view the image attachment.

rungok
07-23-2007, 10:32 PM
Had some initial problems like the one Galt reported, but once I actually saved a valid png-watermark instead of a GIF (why did I do that in the first place?) without transparency it worked just fine. Thanx for this excellent mod!

Thinkinstein
07-25-2007, 02:56 PM
Anyone know how to disable thumbnail hotlinking with this hack ? I have tried htaccess but in vain.

Raven_FCF
08-04-2007, 07:13 AM
no idea. i tried this but like a lot of people...it doesn't work.

ConqSoft
08-04-2007, 09:42 AM
no idea. i tried this but like a lot of people...it doesn't work.

If you follow all of the instructions, and do everything noted, it works just fine.

The people who said it didn't work, finally did get it to work when they followed all of the instructions and the Notes/Troubleshooting section above.

Sean James
08-09-2007, 10:06 AM
Awesome, been waiting and searching for something like this for ages.

Im guessing there is no problems with this hack and vb3.6.8?

Sean James
08-09-2007, 12:35 PM
installed and works great ;) good work

ND4SPD
08-09-2007, 11:57 PM
Nice mod - works great. Thanks!

geevest.com
09-13-2007, 03:48 AM
not work for me?

/usr/www/home/abc/abc.com/images/watermark.png

Alibass
09-15-2007, 05:11 PM
@ConqSoft

Nice hack and thanks for sharing. Works great! :)

Alibass
09-23-2007, 07:05 AM
@ConqSoft

Can your hack be modify to work with vB-Blog v1.01?

ndut
09-27-2007, 11:46 AM
hello.. can somebody help me, please..

i've tried to try this cool add ons.. but it doesn't work..
i've followed this script step by step... still no working..

i'm using vbulletin 3.6.8
i've put file attachment_watermark.php into my root forums folder
i've put file watermark.png into my images folder..
i've install the product-attach_watermark.xml Product via the vBulletin AdminCP Product Manager. still not working..

what should i type in "Watermark Image Location"
if my images. i stored in httpdocs/images folder..
fox example.. my site names is : www.ndut.com
now, i type : /ndut.com/httpdocs/images/watermark.png
but, doesnt work..

can somebody help me?? thanks before..

clonebaby
10-02-2007, 04:50 PM
I'm using 3.6.8 but it doesn't work. Anybody help me please. Is it work with 3.6.8?

nickypoooo
10-18-2007, 10:18 PM
3.6.8 doesn't work, Anybody help us please

ConqSoft
10-18-2007, 10:23 PM
3.6.8 doesn't work, Anybody help us please

Works perfectly fine on 3.6.8 (and 3.6.8 PL1)

Alibass
10-18-2007, 10:53 PM
I am using it on 3.6.8 PL1 also and it works great, fantastic mod! :)

davidw
11-05-2007, 02:08 AM
How difficult would watermarking the thumbnails be?
I've rewritten some of this to add a second watermark (for smaller images). That worked out nicely. But I've not figured out watermarking thumbs yet.

peterpigman
11-05-2007, 10:21 AM
How difficult would watermarking the thumbnails be?
I've rewritten some of this to add a second watermark (for smaller images). That worked out nicely. But I've not figured out watermarking thumbs yet.

Why bother? thumbs are too small to watermark imho.

davidw
11-05-2007, 10:46 AM
When thumbs are set to 640px (actual size is much larger), there are nearing 200k images, and it is requested that thumbs are watermarked, I will try to watermark them. If they can't be done with this hack, I will find an alternate route.

TheAllusionist
11-16-2007, 07:25 AM
First off, I want to say that you did and excellent job in the documentation, I remember when I first started out and had to modify code, some authors assumed a lot of knowledge of the end users, your instructions could have been followed by a third grader.

Worked fine right away on 3.6.8 SP2. I tried to read through all the post and I assumed that this was done with Brian of vBadvanced fame that it would work with his CMPS portal as far as guest viewing thumbnails, but it doesn't seem to which is a real shame and the main reason I installed it.

An idea I had for a future realease that may or may not be easy is a frame with a thick bottome or just the bottom where text and logo could go. This is something like the images at CGsociety.org in the CG Choice Galleries.

Well I just wanted to chime in and say great work and that it worked fine right from the get go!

LCN2007
12-11-2007, 03:42 PM
if someone right clicks your image and saves it will it save with the water mark or is this a fake watermark i saw earlier that it doesnt change the file?

LCN2007
12-11-2007, 03:49 PM
Also can someone tell me how to figure out if i have GD2 on my server i think i have GD1.8?
Plz help.

ConqSoft
12-11-2007, 04:00 PM
Did you try it? ;)

Yes, the watermark will be there. The image is altered at the time its displayed, but not altered on the drive itself.

LCN2007
12-11-2007, 05:01 PM
I have not tried it yet but i will i just got done making all the file edits. I hope it works also does just the watermark itself have to be a JPG or PNG or does this only watermark images that are JPG or PNG?

Im pretty sure it will watermark any attachment but the watermarkitself has to be a JPG or PNG correct?

iCafe
12-25-2007, 01:50 PM
i want Allow Guests to View Thumbnails one option don't have watermark.

help me pl,

Cristi_XP
12-28-2007, 11:50 PM
hello.. can somebody help me, please..

i've tried to try this cool add ons.. but it doesn't work..
i've followed this script step by step... still no working..

i'm using vbulletin 3.6.8
i've put file attachment_watermark.php into my root forums folder
i've put file watermark.png into my images folder..
i've install the product-attach_watermark.xml Product via the vBulletin AdminCP Product Manager. still not working..

what should i type in "Watermark Image Location"
if my images. i stored in httpdocs/images folder..
fox example.. my site names is : www.ndut.com
now, i type : /ndut.com/httpdocs/images/watermark.png
but, doesnt work..

can somebody help me?? thanks before..

look carrefully at the error message,the error message shows the physicall adress.
Mines is something like this /home/my_username/public_html/forum/watermark.png
Can`t we set transparency to the watermark ?

geevest.com
01-05-2008, 12:52 AM
sir i following step by step how to install this module,but until right now the watermark is didn't show.can u help me with my problem? im using vbulletin 3.68

xcesiv
02-11-2008, 08:21 PM
quick questions with this mod..

1) If a member is to save the image that is being viewed with the water mark, will the image be saved with the watermark on it.

2)How do you tell if the server has GD2 installed?

3) Wat does it mean by "Attachments must be stored in the file system. Database storage of file attachments will not work" Im currently using the Image Uplaod system built into 3.6.8. Will it watermark these images.

Thank you for your help

xcesiv
02-12-2008, 04:06 AM
i have installed this and i cant see it working.

I have the watermark uploaded and i confirmed that GD2 is installed.

Can anyone please give me an idea.

www.teamillusiv.com

haytham
02-12-2008, 07:24 PM
Sorry. A lame question. If a member downloads an image to his PC, will it carry the watermark or will the watermark work inside the forum only?

Boofo
02-12-2008, 07:28 PM
Will this watermark image thumbnails, too?

peterpigman
02-12-2008, 07:52 PM
Will this watermark image thumbnails, too?

It will if you set it low enough but watermarking thumbs is not necessary imo.


Sorry. A lame question. If a member downloads an image to his PC, will it carry the watermark or will the watermark work inside the forum only?

It will have the watermark.

Boofo
02-12-2008, 08:07 PM
The reason I asked about the thumbnails is I have a friend who is looking for a hack that does image watermarking on thumbnails. But they are not always the same size. How hard would this be to adapt for thumbnails of different sizes?

Alibass
02-12-2008, 09:01 PM
Sorry. A lame question. If a member downloads an image to his PC, will it carry the watermark or will the watermark work inside the forum only?

If you right click and save image the image will have the watermark. I don't think the original image is watermarked when you allow a actual download of the image.
Programs like PhotoPost allow watermarking of the the original image on the upload and on the fly.

peterpigman
02-13-2008, 08:12 AM
The reason I asked about the thumbnails is I have a friend who is looking for a hack that does image watermarking on thumbnails. But they are not always the same size. How hard would this be to adapt for thumbnails of different sizes?

Your problem would be the watermark. If it is small enough to mark a thumb you wouldn't see it on a large image.

xcesiv
02-13-2008, 09:19 AM
What happens when the watermark is bigger than the actual image?????

peterpigman
02-13-2008, 01:48 PM
What happens when the watermark is bigger than the actual image?????

It would look stupid.

xcesiv
02-13-2008, 07:09 PM
i finally got mine working and looks great.

As for if the watermark is bigger, that depends on what ur watermark is if it will look stupid

The watermark is overlayed over the the image and the image stays the sizes of the original image, not increasing to the size of the watermark which was the question i was kinda getting at.

Rideharder
02-14-2008, 03:43 PM
I tryed and tryed.. Removed

http://speedaholic.net

ptstefa
02-25-2008, 08:33 AM
this plugin apply only in photos in posts of messages.
can i have this watermark also in my albums and in photos of social croups?

Kanustep
03-10-2008, 01:40 PM
Does it work on 3.7 Beta *?

R1lover
03-21-2008, 12:23 AM
Can anyone re-code this for 3.7?

I'm not able to get it working as it was in 3.6.8

R1lover
03-21-2008, 04:35 PM
anyone want to tackle this?

samiro
03-24-2008, 01:40 PM
its not working...

how can i add the watermark to all the photos that alredy uploaded to the forum ?

for now... unInstalled

sturdy
03-24-2008, 04:14 PM
Yeah !!! Searched a long time for this shit :) Thx alot !!!

samiro
03-24-2008, 11:16 PM
now its work fine... i canged the GIF file to PNG... now its OK

BTW... the quality of the watermark is so poor... how can i fix it ?

haytham
03-25-2008, 09:17 AM
A question. If someone saves the pic from my forum to his PC, will it have the watermark on it or will the pic be saved without it?

samiro
03-25-2008, 11:02 AM
it will have the watermark...

haytham
03-25-2008, 04:14 PM
Thank you.

haytham
03-25-2008, 04:48 PM
Ok. I am having trouble with the attachment_watermark. php. Why didn't this file come with the mod? It would've been a lot easier. Anyone have this file for 3.68?

samiro
03-25-2008, 05:22 PM
i just want to say - do you know that i can't see a watermark in IE6.0 with windows 2000 becouse the atachment is not opend in the IE... the opend other program like ACDSEE...

but in the same computer, i can see the watermark in FF...

samiro
03-25-2008, 05:22 PM
i have the attachment_watermark. php for 3.68 PL2

PixelFx
04-15-2008, 09:29 AM
is there a version of this that works for vbulletin 3.7.x ? and or for say maybe profile public photo albums .. or something like this?

Chili
04-24-2008, 11:42 AM
Thanks for posting this. It helped me a lot. :up:

samiro
05-09-2008, 02:05 PM
you must make a new version for 3.7 with the light box...

this plugin is must

InoffLine
05-11-2008, 05:45 PM
Great plugin.
It's the only thing which prevent me from updating to 3.7

samiro
05-11-2008, 09:33 PM
Great plugin.
It's the only thing which prevent me from updating to 3.7

Yes. They must make 1 for VB3.7
It really great plug-in... :)

Kahuna900
05-12-2008, 02:56 PM
It works for 3.7, you just need to disable the light box.

samiro
05-13-2008, 08:42 AM
It works for 3.7, you just need to disable the light box.

i will not disable the Lightbox...

there must be a way to combine this 2 plugins !

GaiLoan
05-22-2008, 11:36 PM
install, working great, thanks

feverinlove
05-23-2008, 01:34 PM
yea, make this for 3.7 !!!!!!

davis31b
05-24-2008, 06:54 AM
I am running VB 3.7.0 and not having any issues with the watermarking.. of course I would like the lightbox to work.

*installed

samiro
05-24-2008, 07:36 AM
I am running VB 3.7.0 and not having any issues with the watermarking.. of course I would like the lightbox to work.

*installed

its working with VB 3.7
but you cant use it when the LightBox is Enabled...

geevest.com
05-30-2008, 04:56 PM
in other attachment (pic) i get error :

Warning: getimagesize([path]/attachment/1/4/5/1/0/988.attach) [function.getimagesize]: failed to open stream: No such file or directory in [path]/attachment_watermark.php on line 93

Warning: Cannot modify header information - headers already sent by (output started at [path]/includes/class_core.php:3237) in [path]/attachment_watermark.php on line 181

Warning: Cannot modify header information - headers already sent by (output started at [path]/includes/class_core.php:3237) in [path]/attachment_watermark.php on line 182

Warning: Cannot modify header information - headers already sent by (output started at [path]/includes/class_core.php:3237) in [path]/attachment_watermark.php on line 183

Warning: Cannot modify header information - headers already sent by (output started at [path]/includes/class_core.php:3237) in [path]/attachment_watermark.php on line 184

Warning: Cannot modify header information - headers already sent by (output started at [path]/includes/class_core.php:3237) in [path]/attachment_watermark.php on line 185

Warning: Cannot modify header information - headers already sent by (output started at [path]/includes/class_core.php:3237) in [path]/attachment_watermark.php on line 186

Warning: Cannot modify header information - headers already sent by (output started at [path]/includes/class_core.php:3237) in [path]/attachment_watermark.php on line 187

Warning: Cannot modify header information - headers already sent by (output started at [path]/includes/class_core.php:3237) in [path]/attachment_watermark.php on line 188
GIF89a

what happen with this?
and how i can fixed this.

R1lover
06-10-2008, 04:29 PM
Anyone willing to get this working with the light box?

t.uzuner
06-22-2008, 01:12 PM
i want this mod but a use 3.7.2 version. this mod is support it?

Kahuna900
06-22-2008, 08:11 PM
It works in 3.7.2, you just need to disable the light box.

geevest.com
06-24-2008, 09:42 AM
we needed a new version for vb.3.7.1 :D

voter
07-07-2008, 01:59 PM
Not really working with 3.7.x

Lightbox that comes with vbulletin don't work reporting

imagelink is not defined vbulletin_lightbox.js Line 11

But when one double clicks on attachment it appears in separate window with watermark defined in this hack.

Seems some recoding in attachment_watermark.php must be done.

ehsanix
07-10-2008, 07:15 PM
great hack
installed & working gretley
thank u 4 sharing this freely

ehsanix
07-10-2008, 07:16 PM
also nominated hack of the month byme
thanks ahead

aajobj
07-11-2008, 11:20 AM
Not really working with 3.7.x

Lightbox that comes with vbulletin don't work reporting

But when one double clicks on attachment it appears in separate window with watermark defined in this hack.

Seems some recoding in attachment_watermark.php must be done.

Just recreate attachment_watermark.php from attachment.php that comes with 3.7.x (follow the mod's instructions how to do it). This worked for me, and with Lightbox on.

ShackMaster
07-21-2008, 01:23 AM
Does not work for me in 3.7 ... with our without Lightbox.

AnabolicResourc
07-21-2008, 06:20 PM
Works great in 3.7.2 !

Thanks !

rushabh
08-02-2008, 11:24 AM
Works like a charm. Thanks for sharing!

mustang_lex
08-06-2008, 01:13 AM
yes I did
here is my attachment_watermark.php

You are a lifesaver. After a few error messages, I uploaded your version and works PERFECT!!!!

frank44
08-27-2008, 05:38 PM
Just recreate attachment_watermark.php from attachment.php that comes with 3.7.x (follow the mod's instructions how to do it). This worked for me, and with Lightbox on.


So you are saying to just follow the same installation steps with this mod as you would if you had 3.6?

frank44
08-27-2008, 06:47 PM
Are you guys having a problem with the pictures hanging when trying to load after clicking on the thumbnails?

minky1
09-03-2008, 07:11 PM
This is a fantastic mod, has anyone managed to get it to work with vbadvanced CMPS ?
I would hope it is possible ?

minky1
09-09-2008, 01:56 PM
Unfortunately this seems to break the 'Limit attachment downloads' mod (https://vborg.vbsupport.ru/showthread.php?t=152701)

:(

nando99
09-09-2008, 06:37 PM
Still can't get it to work with the lightbox on 3.7.3. I've read the full topic a few times and I've just confused myself... lol

Kahuna900
09-09-2008, 08:09 PM
Still can't get it to work with the lightbox on 3.7.3. I've read the full topic a few times and I've just confused myself... lolWho said they got it to work with lightbox? :confused:

The mod works as designed in 3.7.3 with lightbox turned off.

nando99
09-10-2008, 07:24 PM
You're right... I must've mistaken this mod with another mod. My bad...

acyk
09-14-2008, 04:15 AM
Dear sir

I got some error with some post ,but not every post with the attachement got this error code


Warning: getimagesize([path]/uploads/attachments/2/2657.attach) [function.getimagesize]: failed to open stream: Permission denied in [path]/attachment_watermark.php on line 139

Warning: fopen([path]/uploads/attachments/2/2657.attach) [function.fopen]: failed to open stream: Permission denied in [path]/attachment_watermark.php on line 218


Do you have any idea to solve this problem ?

acyk
09-14-2008, 05:36 AM
I have solved this problem

just go to the /forums/uploads/


chmod -R 777 *


then everything works great now

chapsrulez
09-29-2008, 12:23 AM
Installed and working on 3.7.0
but it only works with a PNG as a watermark image.

dragtech
10-04-2008, 01:54 AM
After some trial and error I finally got it to work.

Exactly what i needed.

codershark
11-25-2008, 10:50 AM
the watermark dont works with gif pictures :-/

geevest.com
11-29-2008, 12:43 AM
please updated for vbulletin a new version 3.7 :D

samiro
12-01-2008, 10:49 AM
yes.
please make one for 3.7 with LightBox

TomasDR
12-05-2008, 03:09 PM
I know various people reporting different things. I want to add something.

For me it is working with 3.7.4PL1 and with Lightbox turned on.

The caveat (for me at least), it doesn't work if you use the DB to store attachments. You have to use the filesystem.

Divvy
12-20-2008, 03:54 PM
Dont work with 3.7.4 Patch Level 1 with LightBox enable. :(

samiro
12-22-2008, 07:48 PM
please solve this !!!!!! :):)
or just tell us - what we can try...

scottct1
12-29-2008, 06:04 PM
Anyone have this working with vb 3.8 RC2?

sibcom
01-06-2009, 08:42 PM
+1, vote for 3.7.4

AURFSCAN
01-19-2009, 11:13 PM
Works perfectly on 3.7.2 Patch Level 1

AURFSCAN
01-19-2009, 11:27 PM
Every image that is attached gets the watermark, not just new ones

CrashfAB
01-20-2009, 02:19 AM
I would LOVE to see this for 3.8

I tried it on my test forum and it makes the image a big red x :(

Kahuna900
01-26-2009, 07:30 PM
Still working for me in 3.8.0.

Afrika
02-24-2009, 10:02 AM
Works in 3.8.1 but if guest rights are no attachment, they can view the pic
maybe this ist to modyfy:
original:
($hook = vBulletinHook::fetch_hook('attachment_display')) ? eval($hook) : false;

replaced without hook
if (!$vbulletin->GPC['thumb'] AND defined('WATERMARKED'))
{
imagejpeg($attachimage);
imagedestroy($attachimage);
imagedestroy($watermark);
}

or there
org($hook = vBulletinHook::fetch_hook('attachment_complete')) ? eval($hook) : false;
replace with exit;

geevest.com
02-26-2009, 07:22 AM
may i know about the url path?
if my site : www.abc.com/forum/

dragtech
03-22-2009, 06:13 AM
Works with 3.8.1 but you have to turn off Lightbox. Would really like for it work with Lightbox, any chance of that happening?

MikesSite
04-16-2009, 04:24 AM
followed directions exactly. It works every now and then on 3.8.2 but sometimes says error on page and when you click the attachment it only shows a big black empty transparent box.

z0diac
05-04-2009, 01:08 AM
HOLY smokes... I really need a watermarker (just text) but the process for this mode is just WAAAY to long.

Does anyone know of a simple upload-subdirectory-import-xml type mod for placing simple text on say the bottom right of every uploaded image?

Forensic
05-28-2009, 04:52 PM
Copy and paste a few lines and its done. How much easier do you want?
I just installed it in less than 15 minutes and that was while staying on top of my normal job.

Great Mod btw, I wanted something that would not only watermark new images but also existing (a couple gigs worth). This is exactly what I was looking for.

Thank you!!

z0diac
05-28-2009, 05:14 PM
Actually I just installed this one, very quick (no editing required):
https://vborg.vbsupport.ru/showthread.php?t=201972

EDIT ^^ the above watermark add-on is EASY to install *BUT* - it stops your "Times Viewed" counter from working (when you hover over thumbnails).

I may just try the add-on in this thread now. Except I have a 'guests can view thumbnails' add-on already and am scared that this mod will clash with it and mess the settings up since this one has the same feature.

Zaki Shafqat
08-23-2009, 05:04 PM
is this code work on 3.8.4? please confirm

Vibhor
03-04-2010, 03:54 AM
Hello, Does this mod works on 3.8.3 version? Also, Could anyone try to add a check/un-check option on Manage Attachments window where the user can select whether to watermark the specific image(s) or not.

ausjeepo
07-07-2010, 12:15 AM
Gold... First of many I have tried and worked first go!! AWESOME

http://www.ausjeepoffroad.com/forum/attachment.php?attachmentid=41150&d=1278465142

ifitsmedia
09-21-2010, 06:58 PM
Wish I could find something like this for VB4... looks awesome!

samiro
09-21-2010, 08:53 PM
me 2
you must make this for VB4

Gecuba
11-10-2010, 08:04 AM
<i>Wish I could find something like this for VB4... looks awesome!</i>

+1! No, +100!
Watermarking by hand - so boring process...

Lionel
11-10-2010, 10:52 AM
you could easily watermark with CSS (not permanent though)

BajaBoatOwners
11-15-2010, 02:21 AM
Anyone find something like this for VB4.0.?

Vibhor
08-10-2011, 07:14 AM
How difficult would watermarking the thumbnails be?
I've rewritten some of this to add a second watermark (for smaller images). That worked out nicely. But I've not figured out watermarking thumbs yet.
Hi, Can you please share how did you manage to create a second watermark for the thumbnails? The thumbnails on my forum are relatively bigger, hence, any tip will be helpful. Thanks.