dongqian9013 2012-02-10 19:38
浏览 9
已采纳

保存裁剪文件

$row = mysql_fetch_array($result);
$src1 = $row['file_name'];
$targ_w = $targ_h = 350;
$jpeg_quality = 90;
$img_r = imagecreatefromjpeg($src1);
$dst_r = ImageCreateTrueColor( $targ_w, $targ_h );

imagecopyresampled($dst_r,$img_r,0,0,$_POST['x'],$_POST['y'],
$targ_w,$targ_h,$_POST['w'],$_POST['h']);

header('Content-type: image/jpg');
imagejpeg($dst_r,null,$jpeg_quality);

How to go about saving file for this example? this is the source file name, $src1 = $row['file_name']; I can only preview the file, but not save it .

  • 写回答

2条回答 默认 最新

  • dongwen3437 2012-02-10 19:42
    关注

    Second parameter of imagejpeg is save path.

    imagejpeg($dst_r, $src1,$jpeg_quality);
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥20 神经网络Sequential name=sequential, built=False
  • ¥16 Qphython 用xlrd读取excel报错
  • ¥15 单片机学习顺序问题!!
  • ¥15 ikuai客户端多拨vpn,重启总是有个别重拨不上
  • ¥20 关于#anlogic#sdram#的问题,如何解决?(关键词-performance)
  • ¥15 相敏解调 matlab
  • ¥15 求lingo代码和思路
  • ¥15 公交车和无人机协同运输
  • ¥15 stm32代码移植没反应
  • ¥15 matlab基于pde算法图像修复,为什么只能对示例图像有效