[Openfirst-cvscommit] photogallery preview.php,1.2,1.3
Brought to you by:
xtimg
From: <xt...@us...> - 2003-06-02 23:52:01
|
Update of /cvsroot/openfirst/photogallery In directory sc8-pr-cvs1:/tmp/cvs-serv24955 Modified Files: preview.php Log Message: Add support for older GD versions Index: preview.php =================================================================== RCS file: /cvsroot/openfirst/photogallery/preview.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** preview.php 2 Jun 2003 23:26:49 -0000 1.2 --- preview.php 2 Jun 2003 23:51:57 -0000 1.3 *************** *** 41,46 **** $new_h = 100; $new_w = 100; ! $dst_img = imagecreatetruecolor($new_w,$new_h); ! imagecopyresampled($dst_img, $src_img, 0, 0, 0, 0, $new_w, $new_h, imagesx($src_img), imagesy($src_img)); imagepng($dst_img); imagedestroy($dst_img); --- 41,51 ---- $new_h = 100; $new_w = 100; ! if(strpos($a["GD Version"], "2.0") > 0) { ! $dst_img = imagecreatetruecolor($new_w,$new_h); ! imagecopyresampled($dst_img, $src_img, 0, 0, 0, 0, $new_w, $new_h, imagesx($src_img), imagesy($src_img)); ! } else { ! $dst_img = imagecreate($new_w,$new_h); ! imagecopyresized($dst_img, $src_img, 0, 0, 0, 0, $new_w, $new_h, imagesx($src_img), imagesy($src_img)); ! } imagepng($dst_img); imagedestroy($dst_img); *************** *** 56,61 **** $new_h = 100; $new_w = 100; ! $dst_img = imagecreatetruecolor($new_w,$new_h); ! imagecopyresampled($dst_img, $src_img, 0, 0, 0, 0, $new_w, $new_h, imagesx($src_img), imagesy($src_img)); imagejpeg($dst_img); imagedestroy($dst_img); --- 61,71 ---- $new_h = 100; $new_w = 100; ! if(strpos($a["GD Version"], "2.0") > 0) { ! $dst_img = imagecreatetruecolor($new_w,$new_h); ! imagecopyresampled($dst_img, $src_img, 0, 0, 0, 0, $new_w, $new_h, imagesx($src_img), imagesy($src_img)); ! } else { ! $dst_img = imagecreate($new_w,$new_h); ! imagecopyresized($dst_img, $src_img, 0, 0, 0, 0, $new_w, $new_h, imagesx($src_img), imagesy($src_img)); ! } imagejpeg($dst_img); imagedestroy($dst_img); *************** *** 71,76 **** $new_h = 100; $new_w = 100; ! $dst_img = imagecreatetruecolor($new_w,$new_h); ! imagecopyresampled($dst_img, $src_img, 0, 0, 0, 0, $new_w, $new_h, imagesx($src_img), imagesy($src_img)); imagegif($dst_img); imagedestroy($dst_img); --- 81,91 ---- $new_h = 100; $new_w = 100; ! if(strpos($a["GD Version"], "2.0") > 0) { ! $dst_img = imagecreatetruecolor($new_w,$new_h); ! imagecopyresampled($dst_img, $src_img, 0, 0, 0, 0, $new_w, $new_h, imagesx($src_img), imagesy($src_img)); ! } else { ! $dst_img = imagecreate($new_w,$new_h); ! imagecopyresized($dst_img, $src_img, 0, 0, 0, 0, $new_w, $new_h, imagesx($src_img), imagesy($src_img)); ! } imagegif($dst_img); imagedestroy($dst_img); *************** *** 86,91 **** $new_h = 100; $new_w = 100; ! $dst_img = imagecreatetruecolor($new_w,$new_h); ! imagecopyresampled($dst_img, $src_img, 0, 0, 0, 0, $new_w, $new_h, imagesx($src_img), imagesy($src_img)); imagebitmap($dst_img); imagedestroy($dst_img); --- 101,111 ---- $new_h = 100; $new_w = 100; ! if(strpos($a["GD Version"], "2.0") > 0) { ! $dst_img = imagecreatetruecolor($new_w,$new_h); ! imagecopyresampled($dst_img, $src_img, 0, 0, 0, 0, $new_w, $new_h, imagesx($src_img), imagesy($src_img)); ! } else { ! $dst_img = imagecreate($new_w,$new_h); ! imagecopyresized($dst_img, $src_img, 0, 0, 0, 0, $new_w, $new_h, imagesx($src_img), imagesy($src_img)); ! } imagebitmap($dst_img); imagedestroy($dst_img); |