是否可以使用PHP在存储的AWS S3 Bucket图像上应用水印?
如果图像存在与否,并且在应用水印后,我已尝试使用以下检索。
$galleryImg = '_1473241284.jpg';
// echo $galleryImg;
test(file_exists('https://s3-ap-southeast-1.amazonaws.com/bucketname/test123/'.$galleryImg));
//for direct apply watermark on server
if(file_exists('https://s3-ap-southeast-1.amazonaws.com/bucketname/test123/'.$galleryImg)){
// test("hiii");
// echo "hii";
$watermark->apply('https://s3-ap-southeast-1.amazonaws.com/bucketname/test123/'.$galleryImg, 'https://s3-ap-southeast-1.amazonaws.com/bucketname/test123/'.$galleryImg, $watermarkImg, 3);
$response1 = $client->putObject(array('Bucket' => BUCKETNAME, 'Key' => 'bucketname/test123/'.$galleryImg, 'SourceFile' => 'https://s3-ap-southeast-1.amazonaws.com/bucketname/test123/'.$galleryImg, 'ACL' => 'public-read'));
//echo "watermark applied";
}
答案 0 :(得分:2)
您可以使用第三方服务即时应用水印,而不是应用水印并将图像保存回Amazon S3。