Display Random Images Using PHP

Each time the page is loaded an image will be selected at random.
When you add more images to select from, you are less likely to get repeats from one page load to the next.

Images are located at the server in the /images/ folder, note that only images from subject directories will be loaded
so make categories of your images and upload them te te server e.g: /images/planes or /images/cars
Child directorys of subject directories are note supported.


Example

http://imagelib.xonline.nl/get.php?qty=6&hsize=300&vsize=175&mode=exact&subject=cars


Example

Click here to list all subjects


Notes:

Animated gif's are not supported.

All images are being converted to the .png format automatically when called by the script

The image cache will be kept on te server for only 10 seconds, the image will not be available again.


Usage

http://imagelib.xonline.nl/get.php     A single image wil be displayed

qty   http://imagelib.xonline.nl/get.php?qty=3     3 Images will be showed, (Maximum = 12)

hsize   http://imagelib.xonline.nl/get.php?hsize=450     The created image wil be 200px wide

vsize   http://imagelib.xonline.nl/get.php?vsize=275     The created image has a height of 75px

mode   http://imagelib.xonline.nl/get.php?mode=exact     How the image manipulated to fit in above sizes.

subject   http://imagelib.xonline.nl/get.php?subject=cars     Images of cars wil be given

More options see below ...


Use Multiple Options

You must youse the & sybol between multiple options.

http://imagelib.xonline.nl/get.php?qty=3&hsize=300&vsize=175&mode=exact&subject=cars



Options:

qty=1     3 Images will be showed, (Maximum = 12)

hsize=300     The created image wil be 300px wide (Default 150, Max 2028)

vsize=200     The created image has a height of 200px (Default 100, Max 1280)

mode=exact     Image Manipulation: exact, portrait, landscape, auto, crop (Default exact)

subject=cars     Shows images of subject cars will be shown.
         (When not specified, the default images from /images/default/ will be shown.

q=100     Quality v.s. Compression, Default=100 (Best) Value can be 1 ... 100

title=Xonline     The title that wil show up when you hold the mouse above the image

space=3     Amount of spaces between images (Default=0) Value can be 1...5


Notes:

One image: When a subject folder is given, (exists or not) is empty, a black image will be created

More images: When a subject folder is given, (exists or not) is empty, no images will be created






(c) Bastiaan de Jonge / Technorama LLP