Просмотр файла creater.php

Размер файла: 1.23Kb
<?
# Бесплатный фотообменник
# Coding by Kokunov Evgeniy (aka Default_mo)
# ICQ 9 466 366 
# http://free-one.ru
# [email protected]

// Модуль мини автарки на free-one.ru 
// created by trojan, 2009
// last created - 14.03.10        for photo exchange!

Error_reporting(0);
include 'engine/conf.php';
$_GET['id'] = abs(intval($_GET['id']));

$info=mysql_fetch_array ( mysql_query ( "SELECT * FROM `obm_photos` WHERE `id`='" . $_GET['id'] . "' LIMIT 1" ) );
if($info['type']=='image/jpeg')
{
function imageresize($outfile,$infile,$neww,$newh,$quality) {

    $im=imagecreatefromjpeg($infile);
    $im1=imagecreatetruecolor($neww,$newh);
    imagecopyresampled($im1,$im,0,0,0,0,$neww,$newh,imagesx($im),imagesy($im));

    imagejpeg($im1,$outfile,$quality);
    imagedestroy($im);
    imagedestroy($im1);
    }
}
if($info['type']=='image/gif')
{
function imageresize($outfile,$infile,$neww,$newh,$quality) {

    $im=imagecreatefromgif($infile);
    $im1=imagecreatetruecolor($neww,$newh);
    imagecopyresampled($im1,$im,0,0,0,0,$neww,$newh,imagesx($im),imagesy($im));

    imagegif($im1,$outfile,$quality);
    imagedestroy($im);
    imagedestroy($im1);
    }
}
imageresize("","files/".$info['file']."",150,150,75);

?>