[Openfirst-cvscommit] photogallery preview.php,NONE,1.1 gallery.php,1.2,1.3
Brought to you by:
xtimg
From: <xt...@us...> - 2003-06-02 11:42:07
|
Update of /cvsroot/openfirst/photogallery In directory sc8-pr-cvs1:/tmp/cvs-serv13783 Modified Files: gallery.php Added Files: preview.php Log Message: Add image previewing to gallery.php supported by preview.php --- NEW FILE: preview.php --- <?php /* * openFIRST.photogallery - preview.php * * Copyright (C) 2003, * openFIRST Project * Original Author: Tim Ginn <tim...@sy...> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program 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 General Public License for more details. * This program 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ $img = $_GET["img"]; header("Content-Type: image/png"); // Take the image passed to us, rescale it to preview-size. Then display it. $src_img = imagecreatefrompng("$img"); $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); imagedestroy($src_img); ?> Index: gallery.php =================================================================== RCS file: /cvsroot/openfirst/photogallery/gallery.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** gallery.php 1 Jun 2003 22:54:49 -0000 1.2 --- gallery.php 2 Jun 2003 11:42:03 -0000 1.3 *************** *** 91,95 **** $num = 1; } ! echo "<td width='34%'><a target='_blank' href='viewphoto.php?ID=".$_GET['ID']."&PHOTO=".$file."'><center><img height=100 width=152 src=".$dirlocate."/".$file."></center></a></td>"; $num++; } --- 91,95 ---- $num = 1; } ! echo "<td width='34%'><a target='_blank' href='viewphoto.php?ID=".$_GET['ID']."&PHOTO=".$file."'><center><img height=100 width=152 src='preview.php?img=$dirlocate/$file'></center></a></td>"; $num++; } *************** *** 104,106 **** In order to use or copy its content please contact the teams webmaster.</font></p> <p align="center"> </p> ! <?php include($footer); ?> \ No newline at end of file --- 104,106 ---- In order to use or copy its content please contact the teams webmaster.</font></p> <p align="center"> </p> ! <?php include($footer); ?> |