从S3获取图像。旋转它并再次保存S3服务器上的旋转图像

时间:2015-07-08 07:47:37

标签: php image symfony amazon-s3

我正在研究旋转图像功能。

最终用户可以选择旋转图像。我给了ajax调用来旋转图像。

我有像http://myServerName/e8520a11e5809268b920138badc416cf

这样的图片网址

我尝试过以下步骤:

    $src = http://myServerName/e8520a11e5809268b920138badc416cf;
    $content = PCurl::get($src);
    $originalFile = tempnam("/tmp", "tempImageContent");   
    file_put_contents($originalFile, $content);
    $source=imagecreatefromjpeg($originalFile);  //only for jpg file. written switch statmt
    $rotate = imagerotate($source, 90, 0);
    $rotatedTmpFile = tempnam('/tmp', 'rotatedThumbnailImage');
    imagejpeg($rotate, $rotatedTmpFile ,100);

将其存储在S3上。 但是当S3返回哈希键时,我面临以下错误。我正在尝试使用http://bucketname/hash_key

查看图片
<Code>AccessDenied</Code><Message>Access Denied</Message> 

请帮助!!

0 个答案:

没有答案