error_reporting(0);
include("functions.php");
$h1 = "DJ Mike's Image Maker 2";
$h2 = "Create Image";
if ( isset($_GET[width]) && isset($_GET[height]) && isset($_GET[bgcolor]) && isset($_GET[format]) )
{
## validate color ##
$bgcolor = trim($_GET[bgcolor] );
$bgcolor_color = colors( $bgcolor_color, "validate" );
if ( !$bgcolor )
{ $error = "Color is invalid"; }
$width = (int)$_GET[width];
$height = (int)$_GET[height];
if ( $width<1 || $width>550)
{ $error .= "Width must be from 0 to 550
"; }
if ( $height<1 || $height>550)
{ $error .= "Height must be from 0 to 550
"; }
if ( $error )
{
$_SESSION[error] = $error;
header("location:$self");
}
$format = "$_GET[format]";
$image = new Imagick();
$image->newimage( $width, $height, "$bgcolor");
$image->setimageformat( "$format" );
$path = "temp/$ID.$_SESSION[views].$format";
$image->writeimage( "$path" );
# save settings
$_SESSION[path] = "$path";
$_SESSION[format] = "$format";
$_SESSION[bgcolor] = $bgcolor;
$_SESSION[width] = $width;
$_SESSION[height] = $height;
header("Location: display.php");
exit;
echo "test";
}
include("top.php");
?>
Enter a color, width, height and file type. Color must be a valid hexadecimal such as ff0000 or a valid color name such as red. To create a transparent GIF or PNG, enter transparent for the color. Width and height must be from 1 to 550.