Хранилища Subversion ant

Сравнить редакции

Не учитывать пробелы Редакция 523 → Редакция 524

/branches/ant/0.9.x/lib/core.php
905,6 → 905,44
return 0;
}
 
public function uploadPicture($path, $distributive, $datafile) {
$sPath = $this->secure->checkStr($path, 1);
$sDist = $this->secure->checkStr($distributive, 1);
 
$folder = $sPath.$sDist."-orig.png";
$folderN = $sPath.$sDist.".png";
$folderEM = $sPath.$sDist."-em.png";
 
$distlogo = 0;
if (move_uploaded_file($datafile["distlogo"]["tmp_name"],$folder)) {
chmod($folder, 0644);
list($width, $height) = GetImageSize($folder);
$percent = 32/$height;
$newwidth = $width * $percent;
$newheight = $height * $percent;
 
$output = ImageCreateTrueColor($newwidth, $newheight);
$source = ImageCreateFromPNG($folder);
 
ImageCopyResampled($output, $source, 0, 0, 0, 0, $newwidth, $newheight, $width, $height);
ImagePNG($output, $folderEM);
 
$percent = 15/$height;
$newwidth = $width * $percent;
$newheight = $height * $percent;
 
$output = ImageCreateTrueColor($newwidth, $newheight);
 
ImageCopyResized($output, $source, 0, 0, 0, 0, $newwidth, $newheight, $width, $height);
ImagePNG($output, $folderN);
 
unlink($folder);
$distlogo = 1;
}
 
return $distlogo;
}
 
}
 
?>