error_reporting(0); include("functions.php"); $h1 = "DJ Mike's Image Maker 2"; $h2 = "Colorize"; ##### Start Colorize # if ( $_GET[colorize_im_color] && $_GET[colorize_im_opacity] ) if ( $_GET[colorize_im_color] ) { $color = trim($_GET[colorize_im_color]); $color = (string)$color; $opacity = trim($_GET[colorize_im_opacity]); $opacity = (float)$opacity; if ( $opacity < 0 ) { $opacity = 0; } if ( $opacity >1 ) { $opacity = 1; } ## validate color ## $color = colors( $color, "validate" ); if ( !$color ) { $_SESSION[error] = "Color is invalid"; header("location:$self"); exit; } ## end validate ## ############# $image = new Imagick($_SESSION[path]); foreach ($image as $frame) { $frame->colorizeimage("$color", $opacity ); } $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[colorize_im_color] = $color; $_SESSION[colorize_im_opacity] = $opacity; header("Location: display.php"); exit; } ######### end Colorize include("top.php"); ?>