PHP generated headline image

A while ago i wrote a little skript which looks at a given directory and generates dynamicaly a headline image – once a day by cron job or by adding the Script in a <image> tag.
Here´s the way how to use it:
Edit the header.image.php

require_once("header.class.php");
$my_header = new build_header(); //new Headline Image Class
$my_header-&gt;maxheight=100;       //height of your headline graphics

you can add pictures by hand using:

$my_header-&gt;add_Image("./picname.jpg");

or you can add whole directories:

$path = "./path_to_pics/"; //Path/Directory to your Pictures$my_header-&gt;setArrayOfJpegs($path);
$my_header-&gt;shuffle_load();  //shuffle/randomize the pictures

The width of the generated headline picture has a variance. To set the max width to your needs you have to edit the following lines of header.class.php:

class build_header extends Header{
var $minWidth=640;
var $maxWidth=800;

The Projectstatus of this little thing has never been more then testing and i would find any suggestions and code-improvements interesting. This little testpicture will change while you push the refresh-button of your browser.

Dynamical generated PictureHere you can download the files.

This little gimmick is licenced under the apache public licence.

Hinterlasse eine Antwort