error_reporting(0); include("functions.php"); $h1 = "DJ Mike's Image Maker 2"; $h2 = "Posterize"; ##### Start Posterize if ( $_GET[posterize] ) { $posterize = trim($_GET[posterize]); ##### Validate degrees if ( preg_match( "#[^0-9\.]#", "$posterize", $x) ) { $_SESSION[error] = "Degrees are numbers"; header("location:$self"); exit; } ############# $image = new Imagick($_SESSION[path]); $posterize = (float)$posterize; $dither = (bool)$_GET[dither]; if ( $dither == 0 ) { foreach ($image as $frame) { $image->posterizeimage($posterize, FALSE); } } if ( $dither == 1 ) { foreach ($image as $frame) { $image->posterizeimage($posterize, TRUE); } } $format = strtolower( $image->getimageformat() ); $path = "temp/$ID.$_SESSION[views].$format"; $frames = $image->getNumberImages(); if ( $frames > 1) { $image->writeImages("$path", TRUE); } else { $image->writeImage("$path"); } # save settings $_SESSION[path] = $path; $_SESSION[posterize] = $posterize; header("location:display.php"); exit; } ######### end Posterize include("top.php"); ?>