0

I have a good number of images stored in the database all pertaining to users.

I need to find a way to go through them one by one and reduce each image size using PHP.

Is there a good and proper way to do so?

Thanks

MBC870
  • 373
  • 3
  • 8
  • 16
  • PHP IMagick http://php.net/manual/en/book.imagick.php or PHP GD http://php.net/manual/en/book.image.php – Mark Setchell Sep 27 '18 at 08:23
  • Just to clarify, Matthew - are you looking only for image processing library recommendations, or do you want to talk about the full process of retrieving images from the database, decoding base64 data, editing the image and possibly saving it back? – Piotr Sep 27 '18 at 08:54
  • related: https://stackoverflow.com/questions/38124361/why-does-base64-encoded-data-compress-so-bad – online Thomas Sep 27 '18 at 11:30
  • Piotr that is exactly right. And to elaborate further no frontend will be involved in this. Just running a scheduler daily to simply reduce image sizes (only the ones that need resizing of course) - it still has to be readable by the front end though when it is requested. All i need is to just reduce its size in terms of memory. – MBC870 Sep 28 '18 at 21:39

1 Answers1

1

I'd suggest this full OOP library for image processing: https://imagine.readthedocs.io/en/stable/.

Piotr
  • 321
  • 2
  • 6