Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Resize existing images in s3 bucket/folder

I have a thousands of existing images in s3, and I need to resize all images from one folder, and put it in another folder, but still in one bucket. Is there any solution to resize it with or without lambda? And what trigger shoud I use? Thanks in advance

like image 1000
tukangketik Avatar asked Sep 06 '25 04:09

tukangketik


2 Answers

If this is a one-time job I would use the simplest approach:

  1. Start EC2 instance.
  2. Mount S3 bucket as a filesystem with s3fs or goofys.
  3. Run ImageMagick on all the files with scaling parameters.
like image 56
Sergey Kovalev Avatar answered Sep 07 '25 22:09

Sergey Kovalev


Rather than resizing the images, you could consider using a "resize-on-the-fly" service such as:

  • Cloudinary
  • Imgix

You can construct URLs that automatically resize images to the desired size, without having to resize and store them yourself.

like image 30
John Rotenstein Avatar answered Sep 08 '25 00:09

John Rotenstein