【问题标题】:How can I "flip" an image using PHP? [duplicate]如何使用 PHP “翻转”图像? [复制]
【发布时间】:2010-06-09 10:54:53
【问题描述】:

可能重复:
How to resize an image using PHP?

这是我尝试过的:

$image = "images/20100609124341Chrysanthemum.jpg"; 
$degrees = 40; 
// Content type 
header('Content-type: image/jpeg'); 
// Load 
$source = imagecreatefromjpeg($filename);
// Rotate 
$rotate = imagerotate($source, $degrees, 0);
// Output 
imagejpeg($rotate); 

...但我没有得到任何输出。谁能告诉我这是怎么回事?

【问题讨论】:

标签: php gd


【解决方案1】:

【讨论】:

  • $image = "images/20100609124341Chrysanthemum.jpg"; $度= 40; // 内容类型 header('Content-type: image/jpeg'); // 加载 $source = imagecreatefromjpeg($filename); // 旋转 $rotate = imagerotate($source, $degrees, 0); // 输出图像jpeg($rotate);它没有放出任何东西,为什么?
  • 首先使用“error_reporting(-1);”然后尝试不使用 header() 函数,看看你得到了什么错误。您必须确保先加载图像,然后再旋转和输出。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2021-02-08
  • 2017-06-24
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2011-08-11
  • 1970-01-01
相关资源
最近更新 更多