vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   Watermark images (on the fly) (https://vborg.vbsupport.ru/showthread.php?t=68112)

Robbban 08-07-2004 10:00 PM

Watermark images (on the fly)
 
This is something i made because I couldn't find any hack working for 3.0.7. Just took a couple of minutes. ;)


Works with 3.0.7!

Liquid1ce 08-08-2004 12:43 PM

very nice hack thanks

Logikos 08-08-2004 12:46 PM

Nice work, i will test this now.

Robbban 08-08-2004 01:02 PM

Quote:

Originally Posted by Live Wire
Nice work, i will test this now.

Good! :) Please tell me how you think it works! If there is any errors (witch there shouldn't be since I tested it and it works) please don't hesitate to contact me!

Benj 08-08-2004 01:03 PM

thanks man this is just what i need :)

Logikos 08-08-2004 01:07 PM

I tested on my site and it seems nothing has happen. I replaced

PHP Code:

echo $attachmentinfo['filedata']; 

With

PHP Code:

    if (strpos($attachmentinfo['mimetype'],"image/jp")) { $isjpg 1; }
    if (
$isjpg && !$_GET['thumb']) {
        
$filename "/home/vbhacks/public_html/forum/watermark.png"// use a PNG-24 to preserve transparency!

        
$im imagecreatefromstring($attachmentinfo['filedata']);
        
imagealphablending($imtrue);

        
$watermark imagecreatefrompng($filename);

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

        
$w imagesx($watermark);
        
$h imagesy($watermark);
    
        
imagecopy($im$watermark0$y00$w$h);

        
imagejpeg($im""80);
    } else {
        echo 
$attachmentinfo['filedata'];
    } 

And uploaded this in my forums directory. But nothing shows when i click on an attachment. Something im doing wrong?

Robbban 08-08-2004 01:08 PM

Hmmm... Have you tried to reload the page with CTRL+F5? Internet Explorer caches all images :)

Edit:

watermark.png is one thing and watermark.PNG is another. Change the filename. :)

HuangA 08-08-2004 01:12 PM

nice work, I'll try it out now ^^

Logikos 08-08-2004 01:54 PM

I tried what you said and still seems like nothing has happen. Will this only work on vb 3.0.3? cause im using 3.0.0 but the code seems there is no diffrence.

The Coldwood 08-08-2004 02:30 PM

Great hack - really enjoyed it!

SIINSI 08-08-2004 04:52 PM

Very cool, However it is not working in 3.0.1

This is what I have at the end of my attachment.php

echo $attachmentinfo["$imagetype"];
}

Any ideas on how to get this working with 3.0.1?

Thanks,
Miguel

DWard 08-09-2004 06:54 AM

Sorry have I missed something? What is this hack designed for and what does it do? Any screenshots?

Blam Forumz 08-09-2004 07:04 AM

what does watermarking do?

rinkrat 08-09-2004 08:15 AM

It brands your images with your site name or whatever.

Lord Brar 08-09-2004 11:34 AM

WooHoo! Just the thing I have been desparate to get my hands on!!!!

Thanks a million. I will try it out within a day or two.

Johnny 08-09-2004 04:38 PM

great hack, just one problem im having is the image takes longer to load then usually. any way to fix this.

also is their a way to have gif with a watermark as well.

Logikos 08-09-2004 06:03 PM

this don't watermark all formats?

ranger2kxlt 08-09-2004 08:12 PM

I have version 3.0.0 and only show what SIINIS is showing... any ideas?

Highlander 08-10-2004 04:42 AM

it is not showing up .. the watermark.PNG .. also the load of an image as attachment ist now ultra long .. depnediung 10 or 20 seconds till the images loads when i cklick on a thumbnail ..

*going to remove it till its working or anyone knows why its not showing up ..

lifesourcerec 08-10-2004 04:49 AM

a live demo would be nice.

Logikos 08-10-2004 05:44 AM

Quote:

Originally Posted by Highlander
depnediung 10 or 20 seconds till the images loads when i cklick on a thumbnail ..

*going to remove it till its working or anyone knows why its not showing up ..

Ditto......

Ming Keong 08-10-2004 06:27 AM

The watermarking works great, but images are indeed loading much slower than they used to.

Here's an example of the watermarking for those requesting for one: http://www.pdatrends.com/attachment....tachmentid=676

lifesourcerec 08-10-2004 06:32 AM

heh, I'm on broadband and that was still slow.

Jolten 08-10-2004 07:20 PM

Quote:

Originally Posted by Ming Keong
The watermarking works great, but images are indeed loading much slower than they used to.

Here's an example of the watermarking for those requesting for one: http://www.pdatrends.com/attachment....tachmentid=676

If that image is an indication of how images load.. I'll pass.

juanchi 08-11-2004 02:25 AM

I will definitley call this a great hack but the loading problem keeps this hack from becoming a clasic.

Robbban 08-11-2004 04:14 PM

Hmm, yes... I noticed that the "on-the-fly" watermarking isn't good for performance. Going to modify this and release a version that watermarks the uploaded image so the script doesn't have to watermark every image everytime someone requests it.

It will probably be release tonight (in 5h) :D

For you with problems, here are something to notice:

* It's been tested and developed for version 3.0.3
* watermark.PNG and watermark.png is two diffrent filenames. On unixsystem watermark.PNG will NOT work.
* Live demo can be seen at *WARNING, ADULT SITE* www.synd.nu

Johnny 08-11-2004 07:13 PM

Quote:

Originally Posted by Robbban
Hmm, yes... I noticed that the "on-the-fly" watermarking isn't good for performance. Going to modify this and release a version that watermarks the uploaded image so the script doesn't have to watermark every image everytime someone requests it.

It will probably be release tonight (in 5h) :D

For you with problems, here are something to notice:

* It's been tested and developed for version 3.0.3
* watermark.PNG and watermark.png is two diffrent filenames. On unixsystem watermark.PNG will NOT work.
* Live demo can be seen at *WARNING, ADULT SITE* www.synd.nu


sweet i cant wait..

WretchedXXX 08-12-2004 05:56 AM

Any updates yet?

Beermonster 08-12-2004 08:39 AM

Quote:

Originally Posted by SIINSI
Very cool, However it is not working in 3.0.1

This is what I have at the end of my attachment.php

echo $attachmentinfo["$imagetype"];
}

Any ideas on how to get this working with 3.0.1?

Thanks,
Miguel


This is a cool hack works well but for it to work on 3.0.0 and by the look of it 3.0.1 you will need to use this code.

find:
Code:

echo $attachmentinfo["$imagetype"];
And replace it with:
Code:

        if (strpos($attachmentinfo['mimetype'],"image/jp")) { $isjpg = 1; }
        if ($isjpg && !$_GET['thumb']) {
            $filename = "/home/your/path/watermark.png"; // use a PNG-24 to preserve transparency!

            $im = imagecreatefromstring($attachmentinfo['filedata']);
            imagealphablending($im, true);

            $watermark = imagecreatefrompng($filename);

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

            $w = imagesx($watermark);
            $h = imagesy($watermark);
       
            imagecopy($im, $watermark, 0, $y, 0, 0, $w, $h);

            imagejpeg($im, "", 80);
        } else {
                echo $attachmentinfo["$imagetype"];
        }

Remembering to change your /home/your/path/watermark.png

[high]* Beermonster clicks install[/high]

Deska 08-12-2004 09:29 AM

This hack work fine at vB 3.0.3
But watermark wont transparant although I use PNG-24 Type

Any idea?

Johnny 08-12-2004 01:06 PM

Quote:

Originally Posted by Deska
This hack work fine at vB 3.0.3
But watermark wont transparant although I use PNG-24 Type

Any idea?

PNG-8 will transparent the image.

Dennis01 08-12-2004 03:13 PM

Does this work for attachments stored in a filesystem?

acrimony 08-12-2004 03:58 PM

waiting for new update :)

Deska 08-13-2004 08:46 PM

Ok I got it work now, nice hack!

Quote:

Originally Posted by Dennis01
Does this work for attachments stored in a filesystem?

Yes!

Robbban 08-13-2004 09:08 PM

This hack works for non-marked images. I will soon release a modification that will watermark images as they are being uploaded. I'm also thinking of a script that adds a text-file to ZIP/RAR/TAR/GZ archives so you can "watermark" those aswell!

Skyline_GT 08-14-2004 07:27 AM

Quote:

Originally Posted by Robbban
This hack works for non-marked images. I will soon release a modification that will watermark images as they are being uploaded. I'm also thinking of a script that adds a text-file to ZIP/RAR/TAR/GZ archives so you can "watermark" those aswell!

this would be fantastic

Johnny 08-15-2004 11:01 PM

Quote:

Originally Posted by Robbban
This hack works for non-marked images. I will soon release a modification that will watermark images as they are being uploaded. I'm also thinking of a script that adds a text-file to ZIP/RAR/TAR/GZ archives so you can "watermark" those aswell!

so when are u planning on releasing it?

kingady 08-17-2004 02:42 PM

i tried it but it doesnt reallty fit, it goes abit under the pic

kingady 08-17-2004 02:49 PM

my forum doesnt have function/ folder or the file

kall 08-17-2004 10:33 PM

Quote:

Originally Posted by kingady
my forum doesnt have function/ folder or the file

I'll bet you *do* have a file by that name.

It's in the folder that conatins all the functions files, its name is includes/ .


All times are GMT. The time now is 04:43 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01540 seconds
  • Memory Usage 1,825KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (2)bbcode_php_printable
  • (10)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete