加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
sandphoto.php 1.22 KB
一键复制 编辑 原始数据 按行查看 历史
Ma Jian 提交于 2014-02-12 23:24 . import files
<?php
include("sandphoto.inc");
if ((($_FILES["filename"]["type"] == "image/png")
|| ($_FILES["filename"]["type"] == "image/jpeg")
|| ($_FILES["filename"]["type"] == "image/bmp")
|| ($_FILES["filename"]["type"] == "image/tiff")
|| ($_FILES["filename"]["type"] == "image/pjpeg"))
&& ($_FILES["filename"]["size"] < 8000000))
{
if ($_FILES["filename"]["error"] > 0)
{
header("Content-Type: text/html");
print("上传文件错误!");
return;
}
else
{
$filename = $_FILES["filename"]["tmp_name"];
$target_type = $_POST["target_type"];
$container_type = $_POST["container_type"];
//print "type:$container_type";
$parser = new PhotoTypeParser();
$parser->parse('phototype.txt');
$cw = $parser->get_width($container_type);
$ch = $parser->get_height($container_type);
$tw = $parser->get_width($target_type);
$th = $parser->get_height($target_type);
$p = new Photo();
$p->set_container_size($cw, $ch);
$p->set_target_size($tw, $th);
$n = $p->put_photo($filename, $_POST["bgcolorid"]);
// $p->render_image();
// $p->preview_image();
$download_name = $n ."张" . $parser->get_name($target_type) . "[以" . $parser->get_name($container_type) . "冲洗].jpg";
$p->download_image( $download_name );
}
}
?>
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化