You are here: addons4webgui > Home > Macros
User: Visitor
Navigation
News
Login
Text2Image

Documentation

Text2Image Macro for WebGUI

What's this?:

This WebGUI macro creates an image with given text from a template image in the folder uploads/text2image and returns the html tag <img...> or the image url.

System requirements:

  • Web server (tested on Apache 2).
  • WebGUI (tested on WebGUI V7.4.x).
  • Perl module Image::Magick.

Files:

  • WebGUI/docs/Macro_Text2Image.html: This document here.
  • WebGUI/lib/WebGUI/Help/Macro_Text2Image.pm: Help file.
  • WebGUI/lib/WebGUI/Macro/Text2Image.pm: WebGUI macro.
  • WebGUI/lib/WebGUI/i18n/English/Macro_Text2Image.pm: Texts in english language.
  • WebGUI/lib/WebGUI/i18n/German/Macro_Text2Image.pm: Texts in german language.

Installation:

  1. Download the package source from http://sourceforge.net/projects/addons4webgui.
  2. Extract it into your WebGUI install. Example: tar xvfz /path/to/Macro_Text2Image-x.x.x.tar /path/to/WebGUI.
  3. Edit the WebGUI conf file to add the Text2Image macro to the macro list.
  4. Create a new folder text2image in the folder uploads/.
  5. Restart web server.

Usage:

Read template failed! (Exception 435: unable to open image `[DocumentRoot]/uploads/text2image/ [ImageTemplateFileName]': Påk  @ error/blob.c/OpenBlob/2489)

Example: Read template failed! (Exception 430: unable to open file `/data/WebGUI/www/uploads/text2image/titletemplate.png' @ error/png.c/ReadPNGImage/2951)

Macro parameter description:

  1. DocumentRoot - the document root path of your homepage (e.g. /data/WebGUI/www or /srv/www/vhosts/www.example.com/www).
  2. ImageTemplateFileName - the file name of the template image. The template image must be in the folder uploads/text2image.
  3. Text - your text to embed in a image. ImageMagick attribute.
  4. Font - ImageMagick attribute.
  5. Color - ImageMagick attribute.
  6. PointSize - ImageMagick attribute.
  7. Weight - ImageMagick attribute.
  8. Gravity - ImageMagick attribute.
  9. AntiAlias - ImageMagick attribute.
  10. XPos - ImageMagick attribute.
  11. YPos - ImageMagick attribute.
  12. Id - if you set an id, the html tag <img...> will return from the macro, otherwise (without the id parameter) the url of the image will return. (e.g. can be used for animated buttons with javascript). Without any special usage, set a dummy id!

 

Troubleshooting:

See web server log file and/or webgui log file.

Changelog:

V1.0.1:
  • Renamed and updated this document
V1.0.0:
  • First release
Copyright 2008, studio4master
Licensed under the GNU General Public License (GPL) V3

http://addons4webgui.studio4master.ch

            Valid CSS!  
Running on WebGUI 7.6.25-s4m-20090617
Copyright (c) 2001-2009 by studio4master