<?php
//11.811024
$image = imagecreatefromjpeg('test.jpg');
$rotate = imagerotate($image, 90, 0);
list($width, $height) = getimagesize('test.jpg');
// Content type
header('Content-Type: image/jpeg');
$image_p = imagecreatetruecolor($width * 11.811024, $height * 11.811024);
imagecopyresampled($image_p, $rotate, 0, 0, 0, 0, $width * 11.811024, $height * 11.811024, $width, $height);
imagejpeg($rotate);它没有输出任何图像,但当我注释掉imagecreatetruecolor时,它输出了...为什么?我该如何解决这个问题呢?
发布于 2013-08-14 01:07:27
我认为这可能是原因:
bool imagecopyresampled ( resource $dst_image , resource $src_image , int $dst_x , int $dst_y , int $src_x , int $src_y , int $dst_w , int $dst_h , int $src_w , int $src_h )这就是函数1。在本例中,参数是emty图片$image_p的目的地
但是你做了imagejpeg($rotate);
使用imagejpeg($image_p);获得正确的输出。
在对其重新采样后,还要尝试旋转它:)
https://stackoverflow.com/questions/18214891
复制相似问题