clownfish / client
Image scaling with AWS S3 and Lambda
Installs: 309
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/clownfish/client
Requires
- aws/aws-sdk-php: ^3.19
This package is not auto-updated.
Last update: 2025-10-20 20:22:29 UTC
README
usage
$secret = 'sharedsecret'; $s3 = 'imghosting-foo'; $cloudfrontRoot = 'https://d2rrvpvpaaof6s.cloudfront.net'; // pass bucket name and region. credentials optional. $service = new Clownfish\Service($s3, 'ap-southeast-1', ['key' => 'foo', 'secret' => 'bar']); // upload image $image = $service->uploadImage('foo.jpg', 'article', 1); // originalFilename is your reference with which you can recreate the Image Object $originalFilename = $image->getFilename(); // output scaled version $image = new Clownfish\Image($originalFilename); $scaledImage = $image->getScaledImage(100, 100, $secret); $scaledUrl = $cloudfrontRoot . $scaledImage->getPath(); echo $scaledUrl."\n";