• [Mod] Image Annotation (Watermark) 2 0 5 1
Currently:  

Author Topic: [Mod] Image Annotation (Watermark)  (Read 988476 times)

0 Members and 3 Guests are viewing this topic.

Offline SLL

  • Hero Member
  • *****
  • Posts: 585
    • View Profile
[Mod] Image Annotation (Watermark)
« on: January 27, 2003, 04:30:46 PM »
Quote
Auto annotate images MOD for 4images - Image Gallery Management System.

Version:      1.4

Author:       Silly Little Lamer <sll@dalnet.ru>

Description:

This MOD automatically places a line of custom text, called "Annotation" on every image uploaded to the Gallery. Fully customizable: font type, size and color, shadow usage, offsets, annotation location, etc. "Batch Annotate" admin plug-in included, to annotate images, uploaded to your gallery before you installed this MOD.

Requirements:    

To use in text annotation mode: GD2+ Library compiled with Freetype support. Also works with ImageMagic, but GD still needed for some functions, which ImageMagic is missing.
For "image embedding" mode you don't need anything.

New in v.1.4

•   NetPBM support in both text and image embedding mode.
•   Media type check (applies annotation only on jpeg images); no ‘gif’ errors anymore.
[/b]

New in v.1.31

•   You can choose the annotation method now: text annotation or embedded PNG image (logo, text, etc.). Image embedding (hopefully) works with ImageMagick even if GD library is not installed on your server. CP annotation settings are now separated from the Gallery Settings. Simplified MOD installation.

New in v.1.2

•   Misc. corrections (read 4images forum), code cleanup. Problem with *nix"rename" solved (hopefully".
•   Now checking if annotation text would fit image width, skipping if not.
•   Now you can use variables in the "annotation text" setting, which will be automatically replaced during annotation:
                   %N for Site Name , %H for full Site URL (http://www.mysite.com), %U for short Site URL (www.mysite.com)  
                   %S for User Name (image uploader name), %D for current date, %T for current time, %B to insert line break into annotation text.
[EDIT by V@no]
there is a bug in annotate.php so, either use single quotes around the variables above (i.e. '%N' or '%T') or do these changes: http://www.4homepages.de/forum/index.php?topic=13719.msg68084#msg68084
[/EDIT]
[/i]

New in v.1.1

•   Now you can customize both text and shadow colors and set alpha blending (text transparency) value for your annotation (thanks to V@no). Transparency using GD2 only!

Installation Level:    Easy
Installation Time:      10 Minutes

Files To Edit:       3

   /4images/member.php
/4images/admin/settings.php
   /4images/lang/english/admin.php

Before installing this MOD! (only if you going to use it in "text annotation mode")
Run this small code below (dont' forget to adjust font path). If you see black square with white text, than your system meets all neccessary requirements.
Code: [Select]
<?php
header 
("Content-type: image/png");
$im imagecreate (18030);
$black imagecolorallocate ($im000);
$white imagecolorallocate ($im255255255);
imagettftext ($im1401021$white"/home/public_html/arial.ttf""GD Freetype test");
imagepng ($im);
imagedestroy ($im);
?>

download: http://www.4homepages.de/forum/index.php?action=dlattach;topic=13719.0;attach=4186


If you get error when run batch_annotate.php
Quote
Warning: require(./../admin/admin_global.php) [function.require]: failed to open stream: No such file or directory in admin/plugins/batch_annotate.php on line 8
Fatal error: require() [function.require]: Failed opening required './../admin/admin_global.php' (include_path='.') in admin/plugins/batch_annotate.php on line 8
Then open batch_annotate.php
Find:
$root_path = (eregi("\/plugins\/"$PHP_SELF)) ? "./../../" "./../";

Replace it with:
$root_path "./../../";

The attached package already fixed.
« Last Edit: July 18, 2014, 05:52:53 PM by kai »

Offline edwin

  • Full Member
  • ***
  • Posts: 199
    • View Profile
    • http://www.foto-janssen.nl
[Mod] Image Annotation (Watermark)
« Reply #1 on: January 27, 2003, 04:37:57 PM »
Where can i see a demo of this MOD

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
[Mod] Image Annotation (Watermark)
« Reply #2 on: January 27, 2003, 05:54:25 PM »
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline SLL

  • Hero Member
  • *****
  • Posts: 585
    • View Profile
[Mod] Image Annotation (Watermark)
« Reply #3 on: January 27, 2003, 07:40:39 PM »
Cyrillic users only:

To be able to write annotations in Russian, add this function at the beginning of annotate.php

Code: [Select]
function CyrText($aTxt) {
$isostring = convert_cyr_string($aTxt, "w", "i");
for ($i=0; $i < strlen($isostring); $i++){
$thischar=substr($isostring,$i,1);
$charcode=ord($thischar);
$uniline.=($charcode>175) ? "&#" . (1040+($charcode-176)). ";" : $thischar;
}
return $uniline;
}


and after both lines: $ann_text = $config['annotation_text'];
add:
Code: [Select]
$ann_text = CyrText($ann_text);

Offline wenzel-orf

  • Pre-Newbie
  • Posts: 7
    • View Profile
[Mod] Image Annotation (Watermark)
« Reply #4 on: January 31, 2003, 08:27:05 PM »
Fatal error: imagecolorresolvealpha(): requires GD 2.0 or later in /homepages/7/d13364081/htdocs/4images/admin/plugins/batch_annotate.php on line 52

I can only use GD 1.62 - is there a way to use this script with 1.62?

Thx
Robert

Offline SLL

  • Hero Member
  • *****
  • Posts: 585
    • View Profile
[Mod] Image Annotation (Watermark)
« Reply #5 on: January 31, 2003, 09:05:19 PM »
Quote from: wenzel-orf
I can only use GD 1.62 - is there a way to use this script with 1.62?

I can't check myself, but I don't think it will work... there's at least 3 functions used, which are from GD2. Anyway, I wouldn't recommend using this MOD with GD1 due to the miserable quality of resulting images. It's probably acceptable with thumbnails, but not with fullsize images.

Offline FreDyz

  • Newbie
  • *
  • Posts: 36
    • View Profile
[Mod] Image Annotation (Watermark)
« Reply #6 on: February 14, 2003, 01:21:01 AM »
I've got GD 2.0 with FreeType Support enabled (I can see this in phpinfo) but if I try test the server with the small code it doesn't work. I don't know if the problem is with font path: I've uploaded arial.ttf to the server and put the font path according this.... am I doing something bad?

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
[Mod] Image Annotation (Watermark)
« Reply #7 on: February 14, 2003, 01:24:21 AM »
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline FreDyz

  • Newbie
  • *
  • Posts: 36
    • View Profile
[Mod] Image Annotation (Watermark)
« Reply #8 on: February 14, 2003, 01:43:47 AM »
But that is for use GD in order to make thumbails, I've use GD for thumbails and it works fine in the server but the small code doesn't work.  :?

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
[Mod] Image Annotation (Watermark)
« Reply #9 on: February 14, 2003, 01:49:42 AM »
but did u do that?  :roll:
this mod REQUERED GD2.
making thubnails does not requered GD2, and if u dont do that changes, 4images wont use fully features of GD2
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline FreDyz

  • Newbie
  • *
  • Posts: 36
    • View Profile
[Mod] Image Annotation (Watermark)
« Reply #10 on: February 14, 2003, 01:59:19 AM »
Yes I do that.

But I don't try to install the mod yet, I want to be sure that it will work, and for this reason I used the small test code to test the server, but this doesn't work. Will work the MOD?

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
[Mod] Image Annotation (Watermark)
« Reply #11 on: February 14, 2003, 02:07:11 AM »
ah now I understud what do u mean by "small code".
well, it might be because your GD doesnt support Freetype. did u check the links SLL provided?
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline FreDyz

  • Newbie
  • *
  • Posts: 36
    • View Profile
[Mod] Image Annotation (Watermark)
« Reply #12 on: February 14, 2003, 02:20:53 AM »
Hmmm.... I thought that only GD2 with FreeType support was necessary but checking the links I see that a patch for GD is necessary too :(

Sorry for my questions without read well before  :oops:

Offline SLL

  • Hero Member
  • *****
  • Posts: 585
    • View Profile
[Mod] Image Annotation (Watermark)
« Reply #13 on: February 14, 2003, 08:34:03 AM »
Quote from: FreDyz
Hmmm.... I thought that only GD2 with FreeType support was necessary but checking the links I see that a patch for GD is necessary too :(
This patch is not a "must", but with patched GD image quality is much better

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
[Mod] Image Annotation (Watermark)
« Reply #14 on: February 20, 2003, 04:06:14 AM »
I think the code that inserts in /member.php should be inserted BEFORE
Code: [Select]
    if (!$uploaderror) { not after
Code: [Select]
 if (create_thumbnail($src, $dest, $quality, $dimension, $resize_type)) {
     $new_thumb_name = $new_name;

because Annotation wont work if auto thumbnail not enabled in the settings.
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)