0
Good afternoon guys, I need to create thumbnails of all images contained in a certain folder and save inside a Thumb folder
Ex:
"Photos" folder with multiple JPG images If the Thumb folder does not exist the code should create and save within that folder the thumbnails of the images contained in photos with the same name.
photos/imagem1.jpg <<< normal image photos/Thumb/imagem1.jpg <<< thumbnail
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 someone help me? Thank you
insert link description here
– Mikaele
Thanks for the message, but I don’t want to use the GD class because it creates the thumbnail only virtually, I want to create a new image and save in another folder.
– Frederico Moreira
With GD you can also save to file, not just send to the browser. The link to the first comment includes an example of this in the reply.
– Júlio Neto
@Julius could give me an example of how to do this by taking all the images from a folder? In the example you have there you only use 1 image. In case I need to reduce 200, 300 images.
– Frederico Moreira
@Fredericomoreira Cara unfortunately, I won’t have time now to write a more complete answer, but you can use the functions opendir and readdir to get a list of all the files in a folder and run the above code for each one.
– Júlio Neto