Generate thumbnails in lambda
staging | production |
---|---|
$result = Curl::to('https://url-to-function.execute-api.us-east-1.amazonaws.com/fn-thumb')
->withData(['bucket' => $bucket, 'key' => $key, 'width' => 1024])
->asJson()
->get();
dump($result->key); // URL the newly created thumbnail
- bucket (required) Bucket name the image is stored in
- key (required) full path filename of the image (bob-31337.jpg)
- width (optional, default: 1024) width of the thumbnail (height will follow the original aspect ratio)
- key the full path filename of the thumbnail created (bob-31337-thumbnail.jpg)