sample-serverless-image-resizer-s3-lambda icon indicating copy to clipboard operation
sample-serverless-image-resizer-s3-lambda copied to clipboard

Fix image resizing Lambda function - resolve variable errors and

Open ImBIOS opened this issue 2 months ago • 0 comments

Summary

Fixed critical bugs in the image resizing Lambda function that were preventing resized images from being created and displayed properly.

Issues Fixed

  1. Variable name error: Fixed undefined resized_path variable in download_and_resize function (line 61)
  2. Duplicate upload: Removed redundant upload operation that was happening twice
  3. Missing parameter: Added target_bucket parameter to download_and_resize function
  4. Poor error handling: Improved handling of non-image files to prevent unnecessary uploads

Testing

  • Verified image files are properly resized and uploaded to the resized bucket
  • Confirmed non-image files are skipped without attempting resize operations
  • Tested that the web interface now correctly displays both original and resized images with proper file sizes

Before/After

Before: Resized images showed "(bytes)" without actual file sizes in the web interface After: Resized images display proper file sizes and are accessible via presigned URLs

ImBIOS avatar Nov 30 '25 04:11 ImBIOS