douxi6903 2015-07-08 07:47
浏览 32

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

I am working on rotate image functionality.

End users has option to rotate the images. I have given ajax call to rotate the image.

I have image URL like http://myServerName/e8520a11e5809268b920138badc416cf

I have tried implementing below steps:

    $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);

Storing it on S3. But I am facing below error when S3 returns the hash key. And I am trying to see image using http://bucketname/hash_key

<Code>AccessDenied</Code><Message>Access Denied</Message> 

Please help!!

  • 写回答

0条回答 默认 最新

    报告相同问题?