CodeIgniter Forums
How to resize multiple images simultaneously? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Development (https://forum.codeigniter.com/forumdisplay.php?fid=6)
+--- Forum: CodeIgniter 3.x (https://forum.codeigniter.com/forumdisplay.php?fid=17)
+--- Thread: How to resize multiple images simultaneously? (/showthread.php?tid=86884)



How to resize multiple images simultaneously? - JohnMoncatkina - 02-23-2023

I'm attempting to resize several images at once using a foreach loop, but the resizing is not working properly. Only some of the images are being resized per page.

How can I ensure that all of the images are resized simultaneously omeglz within my foreach loop on index()?

Please note that the file manager code is run/loaded through AJAX.


RE: How to resize multiple images simultaneously? - luckmoshy - 02-23-2023

your query is in dilemma so tell us exactly because there is something like dropzone or https://www.dropzone.dev/ why don't you use it? and loop for??? or do you mean  something like or???

PHP Code:
  $bannerName $bannerImg->getRandomName(); 
\
Config\Services::image()->withFile($bannerImg)->fit(1000800true'center')
->
save('imagefolder/'.$bannerName );