All pastes #412042 Raw Edit

Good Image Resizer

public php v1 · immutable
#412042 ·published 2007-03-27 13:28 UTC
rendered paste body
     ////////////////////////////////////////////////////////////////////////////////     ////////////////////////////////////////////////////////////////////////////////     ////////////////////////////////////////////////////////////////////////////////     ////////////////////////////////////////////////////////////////////////////////       This is what you want     ////////////////////////////////////////////////////////////////////////////////     ////////////////////////////////////////////////////////////////////////////////     ////////////////////////////////////////////////////////////////////////////////     ////////////////////////////////////////////////////////////////////////////////      $imgs = getimagesize($image_path . $row['path']);      if($width == 800 || $height == 800) {      } else {      $width = 0;      $height = 0;      if($imgs[0] > $imgs[1]) {        //normal        $width = 800;        $height = 600;      } else {        //portrate        $width = 600;        $height = 800;      }      $im = imagecreatefromjpeg($image_path . $row['path']);      $im2 = imagecreatetruecolor($width, $height);      imagecopyresized($im2, $im, 0, 0, 0, 0, $width, $height, $imgs[0], $imgs[1]);      imagejpeg($im2, $image_path . $row['path']);     ////////////////////////////////////////////////////////////////////////////////     ////////////////////////////////////////////////////////////////////////////////     ////////////////////////////////////////////////////////////////////////////////     ////////////////////////////////////////////////////////////////////////////////