/* ImageMagick class example written by: daniel@bokko.nl (c)1999 - 2003 All copyrights by: Daniël Eiland This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. (http://www.gnu.org/licenses/lgpl.txt) */ $filename = ''; /* Sets the target dir, make sure this directory is writeble by the httpd user */ $targetdir = '/www/s/shann123/htdocs/resize/advanced/images'; if(isset($_FILES['image']) && $_FILES['image']['size'] > 0) { include('imagemagick_class.php'); $imObj = new ImageMagick($_FILES['image']); if(isset($_POST['verbose']) && $_POST['verbose'] == 1) $imObj -> setVerbose(TRUE); $imObj -> setTargetdir($targetdir); if(isset($_POST['resize']) && $_POST['resize'] == 1) $imObj -> Resize($_POST['resize_x'],$_POST['resize_y'], $_POST['resize_method']); if(isset($_POST['crop']) && $_POST['crop'] == 1) $imObj -> Crop($_POST['crop_x'],$_POST['crop_y'],$_POST['crop_method']); if(isset($_POST['square']) && $_POST['square'] == 1) $imObj -> Square($_POST['square_method']); if(isset($_POST['monochrome']) && $_POST['monochrome'] == 1) $imObj -> Monochrome(); if(isset($_POST['negative']) && $_POST['negative'] == 1) $imObj -> Negative(); if(isset($_POST['flip']) && $_POST['flip'] == 1) $imObj -> Flip($_POST['flip_method']); if(isset($_POST['dither']) && $_POST['dither'] == 1) $imObj -> Dither(); if(isset($_POST['frame']) && $_POST['frame'] == 1) $imObj -> Frame($_POST['frame_width'], $_POST['frame_color']); if(isset($_POST['rotate']) && $_POST['rotate'] == 1) $imObj -> Rotate($_POST['rotate_angle'], $_POST['rotate_bgcolor']); if(isset($_POST['blur']) && $_POST['blur'] == 1) $imObj -> Blur($_POST['blur_radius'],$_POST['blur_sigma']); $imObj -> Convert($_POST['convert']); $filename = $imObj -> Save(); $imObj -> CleanUp(); } ?>
Here is your resized picture: |