Imageserver - Info

Contents

Files

The advise is to make a subdomain called image (for example image.domainname.com). And upload the following files here:

image.domainname.com
  cache                         Cache directory
  classes                       Classes directory
    allowedaddresses.php        Class that checks if an IP adress is allowed
    GD.php                      Class for imagemanipulation
    removecache.php             Class to remove all the cache
    Transform.php               Class for imagemanipulation
  config                        Config directory
    removecache_allowedip.php   Configfile for IP-adresses that may remove cache
  fonts                         Fonts directory
   (multiple fonts)
  Imageserver - Info.doc        Info file with most of this information
  index.php                     Root document
  info.php                      This document

Usage

The usage of this imageserver is very easy. Just enter the following url: http://image.domainname.com/?<param1>=<value1>&<param2>=<value2>&img=<the url of an image>.

About Cache

All generated images are cached so they aren't created twice, this improves performance dramaticly, especially for grayscaling. Make sure the cache directory is fully accessable (chmod 777). The url of the incoming image is base64 encoded. This may result in a very long string and so every 100 characters is creates a directory automaticly and stores the image in final directory with the last few chars that are left.

Cache can be deleted, but only by specific IP addresses. If your IP is allowed a link will appear on the info.php page. You can configure this in the following config file: config/removecache_allowedip.php. Just add IP addresses separated by a comma. Tip: Add comments behind the address so you know who you have enabled.

About Fonts

The list of fonts available is generated automaticly on the fonts in the fonts directory. Make sure while adding fonts, that the file is lowercase!

About Parameters

Any query parameter starting with triggers the ImageServer. This identifier is followed by the individual parameters which are separated by an &.

Parameter Name Values Description
General      
img image Any url of an image
q jpeg quality 1-100 default: 80
o order See table below  
gs gray scale 0= keep colors 1= convert to grayscale default: 0
Rotate      
r rotate 0-359 degrees default backgroundcolor: white
Scale      
w width Integer > 0 Aspect ratio is automaticly kept, unless both of the width and height parameters are given.
h height Integer > 0
Crop      
crt crop top Integer > 0  
crl crop left Integer > 0  
crh crop height Integer > 0  
crw crop width Integer > 0  
Mirror      
m mirror 0=none 1= horizontal 2= vertical 3= both This parameter triggers the mirror
Addtext      
text     This parameter triggers the addtext
x   Integer > 0 default: 50 left position of the bottom of the text
y   Integer > 0 default: 50 top position of the bottom of the text
font     default: arial do not use ttf at the end
size     default: 16
angle     default: 0
colorr R from RGB 0-255 default: 0
colorg G from RGB 0-255 default: 0
colorb B from RGB 0-255 default: 0
Gamma      
g gamma Integer > 0  

Order: The priciple is as follows:

This is what is looks like than. The order is defined by adding &o=<order> to the querystring. The 's', 'c' and 'm' stand for scale, crop and mirror. Order 'scm' is default.

Order scm smc csm cms msc mcs
1. rotate rotate rotate rotate rotate rotate
2. grayscale grayscale grayscale grayscale grayscale grayscale
Dynamic part start
3. scale scale crop crop mirror mirror
4. crop mirror scale mirror scale crop
5. mirror crop mirror scale crop scale
Dynamic part end
6. addtext addtext addtext addtext addtext addtext
7. gamma gamma gamma gamma gamma Gamma