4images Modifications / Modifikationen > Mods & Plugins (Releases & Support)

[Mod] Image Annotation (Watermark)

(1/182) > >>


--- Quote ---Auto annotate images MOD for 4images - Image Gallery Management System.

Version:      1.4

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


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.


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

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


--- End quote ---
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: ---<?php
header ("Content-type: image/png");
$im = imagecreate (180, 30);
$black = imagecolorallocate ($im, 0, 0, 0);
$white = imagecolorallocate ($im, 255, 255, 255);
imagettftext ($im, 14, 0, 10, 21, $white, "/home/public_html/arial.ttf", "GD Freetype test");
imagepng ($im);
imagedestroy ($im);
--- End code ---

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
--- End quote ---
Then open batch_annotate.php
$root_path = (eregi("\/plugins\/", $PHP_SELF)) ? "./../../" : "./../";

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

The attached package already fixed.

Where can i see a demo of this MOD

try here:

Cyrillic users only:

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

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

--- End code ---

and after both lines: $ann_text = $config['annotation_text'];
--- Code: ---$ann_text = CyrText($ann_text);
--- End code ---

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?



[0] Message Index

[#] Next page

Go to full version