Create thumbnails of multiple images in one folder at once

Good Afternoon folks, I'm needing to create thumbnails of all images contained in a given folder and save inside a thumb

Ex:

"Photos" folder with multiple JPG images If the thumb folder does not exist the Code must create and save within this folder the thumbnails of the images contained in photos with the same name.

Photos / image1.jpg

I only found codes that do this resizing while uploading the images, but this is not the case, since the images are already on the server. Could anyone help me? Thank you

Author: Frederico Moreira, 2018-06-28