Файл: iwup.biz/boi/pic.php
Строк: 38
<?php
header("Content-type: image/jpeg");
include_once('config.php');
$fid=mysql_escape_string($_GET['file']);
$neww=$minx;
$newh=$miny;
list($x,$y , $type,)=@getimagesize($fid);
$file=$fid;
if($minx<$y or $miny<$x)
{
$sxy=round($x/$y,3);
$swh=round($neww/$newh,3);
if($sxy<$swh)
$neww=intval($newh*$sxy);
else
$newh=intval($neww/$sxy);
}
else
{
$neww=$x;
$newh=$y;
}
if ($type==1) {$funci="imagecreatefromgif";} //$funco="imagegif";}
if ($type==2) {$funci="imagecreatefromjpeg";} //$funco="imagejpeg";}
if ($type==3) {$funci="imagecreatefrompng";} //$funco="imagepng";}
if($type)
{
$im1 = @$funci($file);
$im2=@imagecreatetruecolor($neww,$newh);
@imagecopyresized($im2, $im1, 0,0,0,0,$neww,$newh, @imagesx($im1), @imagesy($im1));
//@
@imagejpeg($im2) or die('sdfj');
}
//////////////
?>