【发布时间】:2014-09-10 15:35:59
【问题描述】:
试图解决从 IOS 设备上传图像的问题,其中 exif 方向保持不变,导致它们有时会旋转。
我发现了很多关于使用 imagerotate 来解决这个问题的 sn-ps,但我试图实现它们。
为了保存我正在使用的图像:
$moveUploadedFile = move_uploaded_file($fileToUpload["tmp_name"], $this->uploadDir . "/" . $newFileName);
(取自防弹图片上传类)
我可以通过 switch 语句检查 exif 数据,但无法使 move_uploaded_file 工作。
我已经尝试过(用于测试)例如:
$image = $fileToUpload["tmp_name"];
$image = imagerotate($image, 90, 0);
$moveUploadedFile = move_uploaded_file($image, $this->uploadDir . "/" . $newFileName);
这给了我 move_uploaded_file 请求字符串但接收资源的错误。
有什么帮助吗?
【问题讨论】:
标签: php upload exif image-rotation