I use simple_html_dom to retrieve data from a file ([login to view URL]).
At the moment, the code I have in place in [login to view URL] finds, resizes, sharpen and upload them to my server. It works if each image name is different, but it doesn't if all the images have the same name (ex: same name, but downloaded from different directories). In this particular case, all images are named 300x500.jpg.
1. Modify the script so that if data is found between the h4 attributes in the [login to view URL] file, use it as new names for the images ([login to view URL], [login to view URL], [login to view URL], etc. instead of [login to view URL]). If no data is found in h4, keep the original image names (last image in data file is like that).
I do not need anything fancy, no timestamp or unique ids, the data in the h4 attributes will already be unique.
2. Add a function that checks if the file already exists on my server before creating the image. Only create the image if it doesn't already exist.
3. Convert the current GD functions to imagemagick and clean up unnecessary code. I believe the script was originally written to use the longest side of the image as the max size but it doesn't work. I would like that function to work (use the $max = 200 as the size of the longest side of the thumbnail).
I would also like to use the following imagemagick command to modify/sharpen the images:
-strip -sharpen 0.7x1 -enhance -sampling-factor 4:2:0 -interlace JPEG
Since I will be using imagemagick command to sharpen/modify the thumbs, I am guessing you can remove the actual "imagesharpe" function.
I, of course, want to retain the ability to choose the quality of the thumbnails (ex: $quality = 80).
This script will be running on php 7.3+
I want quality, easy to read/understand, code.