• [MOD] On-fly image annotation ( watermark) 4 0 5 1
Currently:  

Author Topic: [MOD] On-fly image annotation ( watermark)  (Read 92235 times)

0 Members and 1 Guest are viewing this topic.

Offline batu544

  • Sr. Member
  • ****
  • Posts: 336
    • View Profile
    • Free Celebrity wallpapers
[MOD] On-fly image annotation ( watermark)
« on: November 27, 2008, 09:06:57 AM »
Hi all,

here is a way to watermark the images on-fly instead of actually watermarking the images.. When the user will try to download, the original image will be downloaded...  :D


1. Upload the following file as watermark.php

Code: [Select]
<?php

header
('content-type: image/jpeg');
$img $_GET['img'];
$watermark imagecreatefrompng('watermark.png');

$watermark_width imagesx($watermark);
$watermark_height imagesy($watermark);
$image imagecreatetruecolor($watermark_width$watermark_height);
$image imagecreatefromjpeg("$img");
$size getimagesize("$img");
$dest_x $size[0] - $watermark_width 5;
$dest_y $size[1] - $watermark_height 5;

imagecopymerge($image$watermark$dest_x$dest_y00$watermark_width$watermark_height100);
imagejpeg($image);
imagedestroy($image);
imagedestroy($watermark);

?>


2. Open jpg.html from your template/xxx/media folder and change
Code: [Select]
<img src="{media_src}" border="1" alt="{image_name}"{width_height} /><br />
to

Code: [Select]
<img src="./watermark.php?img={media_src}" border="1" alt="{image_name}"{width_height} /><br />


3. Upload your watermark.png picture.. to root folder.

4. Now all set .. you can see the watermarked images ..   :D


Demo : bhwallpapers  ( You need to click on the image to see the actual watermarked image )
Thanks

Edit: Sorry, now the demo is not available due to the changes in the website design.. :(
« Last Edit: June 12, 2010, 08:58:00 PM by batu544 »

Offline mawenzi

  • Moderator
  • 4images Guru
  • *****
  • Posts: 4.500
    • View Profile
Re: On-fly image annotation ( watermark).
« Reply #1 on: December 06, 2008, 07:58:31 PM »
Hi batu544 ...

... thanks for sharing this watermark mod ... it works perfectly ...
... I moved the thread to Mods & Plugins (Releases & Support) ...
... only three hints for other users ...

1. if you want to show the watermark in the middle of your image, use this in your watermark.php ...
Code: [Select]
$dest_x = $size[0]/2 - $watermark_width/2 ;
$dest_y = $size[1]/2 - $watermark_height/2;

2. if you want to show the watermark only to guests (non registered users), use this in your jpg.html ...
Code: [Select]
{if user_loggedin}<img src="{media_src}" border="1" alt="{image_name}"{width_height} /><br />{endif user_loggedin}
{if user_loggedout}<img src="./watermark.php?img={media_src}" border="1" alt="{image_name}"{width_height} /><br />{endif user_loggedout}

3. perhaps you should use a transparent gif-watermark image ...
... because IE6 can not right show transparent png-images ...
Your first three "must do" before you ask a question ! ( © by V@no )
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

You are on search for top 4images MOD's ?
- then please search here ... Mawenzi's Top 100+ MOD List (unsorted sorted) ...

Offline batu544

  • Sr. Member
  • ****
  • Posts: 336
    • View Profile
    • Free Celebrity wallpapers
Re: [MOD] On-fly image annotation ( watermark)
« Reply #2 on: December 07, 2008, 01:51:54 PM »
Thanks mawenzi !! for moving this to Mods & Plugins (Releases & Support) section.


Offline Sunny C.

  • Addicted member
  • ******
  • Posts: 1.805
  • I ♥ 4I
    • View Profile
Re: [MOD] On-fly image annotation ( watermark)
« Reply #3 on: December 07, 2008, 04:21:19 PM »
Very Very Very Nice :D

Offline mawenzi

  • Moderator
  • 4images Guru
  • *****
  • Posts: 4.500
    • View Profile
Re: [MOD] On-fly image annotation ( watermark)
« Reply #4 on: December 07, 2008, 05:28:02 PM »
3. perhaps you should use a transparent gif-watermark image ...
... because IE6 can not right show transparent png-images ...

... just tested in IE6 ... and it works perfektly with png-watermark image ...
Your first three "must do" before you ask a question ! ( © by V@no )
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

You are on search for top 4images MOD's ?
- then please search here ... Mawenzi's Top 100+ MOD List (unsorted sorted) ...

Offline kai

  • Administrator
  • Addicted member
  • *****
  • Posts: 1.421
    • View Profile
    • 4images - Image Gallery Management System
Re: [MOD] On-fly image annotation ( watermark)
« Reply #5 on: December 08, 2008, 08:29:43 PM »
Great! Thank you!
Your first three "must do" before you ask a question:
1. Forum rules
2. FAQ
3. Search

Offline Pedrocas

  • Newbie
  • *
  • Posts: 22
    • View Profile
Re: [MOD] On-fly image annotation ( watermark)
« Reply #6 on: February 01, 2009, 07:14:13 PM »
This seems great!
I have 2 questions:

- Where do I upload the watermark.php file?
- How will the already added pictures been show?

Thanks,

Offline batu544

  • Sr. Member
  • ****
  • Posts: 336
    • View Profile
    • Free Celebrity wallpapers
Re: [MOD] On-fly image annotation ( watermark)
« Reply #7 on: February 02, 2009, 05:20:02 AM »
HI,

1.      Upload it in root folder. ( where you have installed your 4image).
2.      It will not really add any watermark to the images. So, It will also work in the same way for the wallpapers which are already added.

Thanks


Offline Pedrocas

  • Newbie
  • *
  • Posts: 22
    • View Profile
Re: [MOD] On-fly image annotation ( watermark)
« Reply #8 on: February 02, 2009, 10:46:08 AM »
Thanks for the reply.
That's precisely my problem, because all the 3500 images that I have are already tagged.
Any possible solution for this?

Offline batu544

  • Sr. Member
  • ****
  • Posts: 336
    • View Profile
    • Free Celebrity wallpapers
Re: [MOD] On-fly image annotation ( watermark)
« Reply #9 on: February 02, 2009, 01:24:33 PM »
because all the 3500 images that I have are already tagged.

I didn't get your question .. what do you mean by tagged ??


Offline Pedrocas

  • Newbie
  • *
  • Posts: 22
    • View Profile
Re: [MOD] On-fly image annotation ( watermark)
« Reply #10 on: February 02, 2009, 07:30:52 PM »
I mean all my images were marked in photoshop before being uploaded...

Offline mawenzi

  • Moderator
  • 4images Guru
  • *****
  • Posts: 4.500
    • View Profile
Re: [MOD] On-fly image annotation ( watermark)
« Reply #11 on: February 02, 2009, 08:13:47 PM »
a hint ... ;)

... the latest script worked on tagged the images ... either PS on your pc or Annotation on the server ...
... but if you have big-images ( in the big-folder ... a MOD by V@no ) on your server for downloading ...
... then you can use Annotation for images on your detail sites ...
... and you can use the original images (tagged by PS) for downloading ...
                                                   
Your first three "must do" before you ask a question ! ( © by V@no )
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

You are on search for top 4images MOD's ?
- then please search here ... Mawenzi's Top 100+ MOD List (unsorted sorted) ...

Offline cliff

  • Newbie
  • *
  • Posts: 15
    • View Profile
Re: [MOD] On-fly image annotation ( watermark)
« Reply #12 on: February 03, 2009, 01:24:35 PM »
Hallo,

gibt es evtl. eine Möglichkeit das später zu sehende Bild mit der watermark.php auf eine bestimmte Größe zu skalieren. Ich habe zwar gegoogelt, bin aber nicht wirklich weiter gekommen. Gut wäre, wenn das Originalbild auf die spätere Größe skaliert wird und darüber die entsprechende png-Grafik gelegt würde...

Das zu sehende Bild soll für Gäste lediglich 350px breit oder hoch sein... Die watermark.php würde ich dann in watermark1.php umbenennen und für Gäste den Zugriff mit eben dieser php-Datei umsetzen...


-----

is there any option that the new image with the watermark got a fixed size. It would be great if the originall jpeg will be reduced and that new jpeg gets watermarked...
The image in the gallery should have a size of max. 350px (width or heigth)! Than I will change the watermark.php into watermark1.php for viewing the image by guest.

----

Fragende Grüße
cliff
« Last Edit: February 03, 2009, 02:41:36 PM by cliff »

Offline mawenzi

  • Moderator
  • 4images Guru
  • *****
  • Posts: 4.500
    • View Profile
Re: [MOD] On-fly image annotation ( watermark)
« Reply #13 on: February 03, 2009, 04:53:26 PM »
... wenn du ein "Medium"-Bild suchst und dein Originalbild z.B. auch für den Download auf deinem Server speichern willst ...
... dann gibt es das hier ...
... [TUT] One Image - Three Sizes ...
... http://www.4homepages.de/forum/index.php?topic=20496.0 ...
... und welchen Annotations-MOD du dann auch nimmst : "Medium"-Bilder sind dann mit Watermark, Originalbilder ohne Watermark ...
... solltest du dich noch anderen Varianten der Bildscallierung umsehen, so sind in dem TUT noch weitere Varianten aufgeführt ...
Your first three "must do" before you ask a question ! ( © by V@no )
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

You are on search for top 4images MOD's ?
- then please search here ... Mawenzi's Top 100+ MOD List (unsorted sorted) ...

Offline cliff

  • Newbie
  • *
  • Posts: 15
    • View Profile
Re: [MOD] On-fly image annotation ( watermark)
« Reply #14 on: February 03, 2009, 08:05:03 PM »
Hallo Mawenzi,

und danke für die prompte Antwort...

Ich habe ja schon eine Modifikation, so daß sich die Bilder zunächst in das Design einfügen und per Ajax in groß gezeigt werden können. Aber es würde mich schon sehr interessieren, ob man die watermark.php dahingehend ändern könnte, dass zunächst das Originalbild skaliert wird und dann das Wasserzeichen darüber gelegt wird. Ansonsten würde ja auch das Wasserzeichen immens verkleinert werden (analog zur Ursprungsgröße).

Gibt´s da keine Modifikation?

Dankende Grüße
cliff