ReJump

 
ReJump GD Imager script
Technology



 


Home

GD Imager
About
News
How to use
Download
Contacts

Rejump site engine







WebNews.TV news reader soft
Web & RSS News reader soft

About

GD Imager (gd_imager.pl) - the script which allows to modify images in passing
It will help you to arrange you image archive.
It's free!
News
June 6 2003. The 1.2 version of GD Imager (first release) is available. You can download it here.
Download
You can download the GD Imager script. Click here to download (size 3.6K).
How to use

Installation instructions:


1. Copy a file gd_imager.pl in directories in which execution of cgi scripts is authorized
2. Set to a file gd_imager.pl execution rights. For example by the command "chmod 755 gd_imager.pl"
3. Whether check up module GD if is not present establish its by the command "ppm install GD", from a command line


Example of a call:
http://www.site.com/cgi-bin/gd_imager.pl?img=/photo/1.jpg&width=150

img=/photo/1.jpg - specifies the initial image
width=150 - specifies the resulting width of the image

As a result of work of a script - the picture comes back, to make out a call on a site it is necessary as follows:

<img src="http://www.site.com/cgi-bin/gd_imager.pl?img=/photo/1.jpg&width=150">

1. Opportunities of scaling

Source image (example):


Variants of a call:

?img =/photo/1.jpg&width=150 - for reception of images of the set width (150)
Result image:

?img =/photo/1.jpg&height=200 - for reception of images of the set height (200)
?img =/photo/1.jpg&width=150&height=200 - for reception of images of height it is no more 200 and width no more than 150

2. Mounting of pictures with the set substrate

Base image (example png):

Variants of a call:

Without direct indications of the sizes of the image
?img =/photo/1.jpg&base =/img/base.png - for imposing scaling images on a file a substrate /img/base.png.
Result image:

?img =/photo/1.jpg&base =/img/base.png&border=5 - for imposing scaling images on a file a substrate /img/base.png, thus the image will be scaling for a space 5.
Result image:


With the indication of the size scaling images

?img =/photo/1.jpg&base =/img/base.png&width=100 - the image is scaled on width on 100 pixels and then imposed on a file/img/base.png
Result image:


With alignment

?img =/photo/1.jpg&base =/img/base.png&width=100&align=right - to scale, impose, level by a right edge
Result image:


With spaces

?img =... &base =... &width =... &align=right&dx=5 - to scale, impose, level by a right edge with a space 5
Result image:

?img =/photo/1.jpg&base =/img/base.png&width=100&height=120 - to scale the image that it was placed about a rectangular 100x120 pixels (a proportion are observed), to impose on a file /img/base.png
?img =... &base =... &width =... &align=right&dx=5 - - to scale to impose, level by a right edge with a space 5

The parameter "align" - operates alignment across.
Allowable values left, right, center, by default - center

The parameter "valign" - operates alignment on a vertical. Allowable values top, bottom, center, by default - center
Result image (valign=top&dy=5):


The parameter "border" - sets spaces (from two sides or from one of the sides, depending on modes of alignment)

The parameter "dx" - sets a space across (from that side with which there is an alignment or concerning the center of the image if alignment on the center)

The parameter "dy" - sets a space on a vertical, is similar "dx"

3. Use of files of a configuration

It is possible to use config files, for the description of parameters.

The example of parameters of a call:
?img=/photo/1.jpg&conf=../conf/img

In a file ../conf/img (the way determinzting relative of a script directory) is the information on parameters of processing of the image.

The example of contents of a file:

width = 107
height = 103
base = "/i/base.png"
dx = 6
dy = 11

Processing of images in cases of use of files of configurations is absolutely identical to the task of these parameters in a line of a call

4. Caching opportunity

The caching opportunity can be included only from a file of a configuration. The parameter cash_dir sets a way to a cashe directory (for each of configuration files, it there should be a directory)

The example of a configuration file:

width = 107
height = 103
base = "/i/base.png"
dx = 6
dy = 11
cash_dir = "../cash"

The way to cache is set relating to an arrangement of a script gd_imager.pl

Additional parameters cash_time - time of updating cache (in seconds). + Value by default - 86400 (day). cash_slash - sequence a symbol for replacement "/" in a name of a file at record in cache. Value by default - "--".

( /i/1.jpg -> --i--1.jpg )

The example of a configuration file:

width = 107
height = 103
base = "/i/base.png"
dx = 6
dy = 11
cash_dir = "../cash"
cash_slash = "--"
cash_time = 800
Examples
www.dance.org.ua/photos - the example of the technology.
Simple photogallery example. ReJump site engine is using in this example
Contacts
If you have any questions, please, contact us via email: datafile@rejump.com.
Powered by
You can place this button on powered by ReJump sites
or place on site simple link:
   <a href="http://www.rejump.com">powered by ReJump</a>


© 2002 ReJump
© 2002 Arta web design