<?
$Submit = $_POST['Submit'];
if ( $Submit ) {
// Temporary upload image name
$original_image = $_FILES['filename']['tmp_name'];
list($width, $height, $type, $attr) = getimagesize($original_image);
// Get the image dimensions
$size=GetImageSize( $original_image );
// Name to save the image as - in this case the same as the original
$new_image = $_FILES['filename']['name'];
exec("/usr/local/bin/convert $original_image -segment 1x1 +dither -colors 2 -edge 1 -normalize -negate $new_image");
echo "<center><img src=\"".$new_image."\"><br><a href=\"http://www.test.com\" target=\"_blank\">test</a></center>";
}
?>
Partager