Хранилища Subversion ant

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

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

/branches/ant/0.9.x/lib/core.php
905,6 → 905,39
return 0;
}
 
public function uploadPicture($path, $dist, $datafile) {
$folder = $path.$dist."-orig.png";
$folderN = $path.$dist.".png";
$folderEM = $path.$dist."-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;
}
}
 
?>