found this which is nice and quick to implement. It works great but what I want it before the images are uploaded, that they get resized to a max width but keeping the ratio.
Let say i am uploading an image with a width of 5000px, i want this to be resized to 1000px width but keep the height ratio and then save the final image.
Example usage:
/* shrink() - will shrink/resize the image according to the given dimensions (in pixels)
* NOTE, a folder called 'shrinked_images' will be created first to store the uploaded image
*/
$bulletProof
->fileTypes(array("jpg", "gif", "png", "jpeg"))
->uploadDir("shrinked_images")
->shrink(array("height"=>100, "width"=>200))
->upload($_FILES["pictures"]);
The GitHub:
https://github.com/samayo/bulletproof
I have read through the docs but cant find anything about resizing. All i can find in the code is the shrinking function but cant see how to add the keep ratio option with that?
Thanks. Craig.