<?php\r
-\r
+
$img = 'kubrickheader.jpg';\r
-\r
+
// If we don't have image processing support, redirect.\r
if ( ! function_exists('imagecreatefromjpeg') )\r
die(header("Location: kubrickheader.jpg"));\r
-\r
+
// Assign and validate the color values\r
$default = false;\r
$vars = array('upper'=>array('r1', 'g1', 'b1'), 'lower'=>array('r2', 'g2', 'b2'));\r
$default = true;\r
}\r
}\r
-\r
+
if ( $default )\r
list ( $r1, $g1, $b1, $r2, $g2, $b2 ) = array ( 105, 174, 231, 65, 128, 182 );\r
-\r
+
// Create the image\r
$im = imagecreatefromjpeg($img);\r
-\r
+
// Get the background color, define the rectangle height\r
$white = imagecolorat( $im, 15, 15 );\r
$h = 182;\r
-\r
+
// Define the boundaries of the rounded edges ( y => array ( x1, x2 ) )\r
$corners = array(\r
0 => array ( 25, 734 ),\r
180 => array ( 23, 736 ),\r
181 => array ( 25, 734 ),\r
);\r
-\r
+
// Blank out the blue thing\r
for ( $i = 0; $i < $h; $i++ ) {\r
$x1 = 19;\r
$x2 = 740;\r
imageline( $im, $x1, 18 + $i, $x2, 18 + $i, $white );\r
}\r
-\r
+
// Draw a new color thing\r
for ( $i = 0; $i < $h; $i++ ) {\r
$x1 = 20;\r
}\r
imageline( $im, $x1, 18 + $i, $x2, 18 + $i, $color );\r
}\r
-\r
+
//die;\r
header("Content-Type: image/jpeg");\r
imagejpeg($im, '', 92);\r