php 图片改化后的保存问题
<?php//Thefile$filename='D:\AppServ\www\upload_pic\resized_pic.jpg';$percent=0.2;//Co...
<?php
// The file
$filename = 'D:\AppServ\www\upload_pic\resized_pic.jpg';
$percent = 0.2;
// Content type
header('Content-Type: image/jpeg');
// Get new dimensions
list($width, $height) = getimagesize($filename);
$new_width = $width * $percent;
$new_height = $height * $percent;
// Resample
$image_p = imagecreatetruecolor($new_width, $new_height);
$image = imagecreatefromjpeg($filename);
imagecopyresampled($image_p, $image, 0, 0, 0, 0, $new_width, $new_height, $width, $height);
// Output
imagejpeg($image_p, null, 100);
chmod($image_p, 0777);
?>
运行php文件后会得到改过图片 但是我应该怎么再把他保存到ftp上呢 展开
// The file
$filename = 'D:\AppServ\www\upload_pic\resized_pic.jpg';
$percent = 0.2;
// Content type
header('Content-Type: image/jpeg');
// Get new dimensions
list($width, $height) = getimagesize($filename);
$new_width = $width * $percent;
$new_height = $height * $percent;
// Resample
$image_p = imagecreatetruecolor($new_width, $new_height);
$image = imagecreatefromjpeg($filename);
imagecopyresampled($image_p, $image, 0, 0, 0, 0, $new_width, $new_height, $width, $height);
// Output
imagejpeg($image_p, null, 100);
chmod($image_p, 0777);
?>
运行php文件后会得到改过图片 但是我应该怎么再把他保存到ftp上呢 展开
1个回答
展开全部
$this -> targetDir = "路径/".$会员id."/".date(Ym).".文件格式" 是这意思吗?呵呵,你想保存就直接给路径不就行了吗?一般想这样的做法是,从数据库中取出该用户的信息,然后再赋值
不错哦, 谢喽百度很给力的,你瞧下我找滴。http://hi.baidu.com/thuevnit1807/blog/item/4e8ca90122b0bb4ef919b8be.html。
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询