error_reporting(0); include("functions.php"); $h1 = "DJ Mike's Image Maker 2"; $h2 = "Trim"; ##### Start Trim if ( $_GET[trim] ) { $fuzz = (float)$_GET[fuzz]; if ( $fuzz == "" || !isset($fuzz) || $fuzz < 0 ) { $fuzz = 0; } $image = new Imagick($_SESSION[path]); $image = $image->coalesceImages(); foreach ($image as $frame) { $image->trimimage($_GET[fuzz]); } $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[fuzz] = $fuzz; header("Location: display.php"); exit; } ######### end Trim include("top.php"); ?>