Server Engineer @ SundayToz Blog https://mingrammer.com Facebook https://facebook.com/mingrammer Github https://github.com/mingrammer Eng Blog https://medium.com/@mingrammer
handler def lambda_handler(event, context) Check existence of a resized image Get a resized image Put a resized image Resize an image Generate an thumbnail link Amazon S3 resizer code
lambda_handler(event, context): sub = event.get('sub') category = event.get('category') filename = event.get('filename') width = event.get('width') # Check if the image url with given parameter exists # If the format of image is not supported, redirect to original image with Image(file=original_image['Body']) as img: # If width is not set, get width of original image # Check if the width is valid numeric value # If the thumbnail already exists, redirect to that # Image resizing ] event.get('field') ?
Amazon API Gateway AWS Lambda Amazon S3 Valid? Format check Param check Amazon S3 Exists? Resize Save Amazon S3 original thumbnail Get object Get object Put object