我正在使用jquery文件上传 http://blueimp.github.io/jQuery-File-Upload/脚本并已成功将主图像上传到 Amazon S3。我现在尝试更换多个图像尺寸以上传到 S3 中的子文件夹或对象。
在 - 的里面创建缩放图像UploadHandler.php 文件中的函数如何替换
imagecopyresampled 调用与 S3 调用?这可能吗?
以下是调整图像大小并将文件写出的内容:
$success = $src_img && @imagecopyresampled(
$new_img,
$src_img,
$dst_x,
$dst_y,
0,
0,
$new_width,
$new_height,
$img_width,
$img_height
) && $write_image($new_img, $new_file_path, $image_quality);
// Free up memory (imagedestroy does not delete files):
@imagedestroy($src_img);
@imagedestroy($new_img);
我可以以某种方式调整内存中图像的大小,然后将文件保存到我的 S3 对象吗?
$bucket = "pics.mysite.com";
$file = ??
$uploaded_file = ??
$response = $s3->create_object($bucket, $file, array('fileUpload' => $uploaded_file, 'acl' => AmazonS3::ACL_PUBLIC));
if ($response->isOK()) {
//success
}