0

I´m just trying to figure out the way, how can I scale/resize the resolution of an image in PHP. I´m working on an online form where user can upload their picture, then I want to reduce the initial resolution to 300x300px and use move_uploaded_file() function to pass that image to a certain folder. Just to clarify, you can imagine it like this "scale" function bellow.

$user_pic = scale($_FILES['form_image']['tmp_name']); // Scale

$dir = 'assets/img/folder/new_pic.jpg'; // Upload
move_uploaded_file($user_pic, $dir);
  • Use the GD extension [The Manual](http://php.net/manual/en/book.image.php) – RiggsFolly Feb 15 '17 at 10:48
  • Php itself does not have any image manipulation libraries loaded. You would need to install gd extension as most of the ready librarieds use this extension (you would also need it if you would write manipulation yourself.) – Auris Feb 15 '17 at 10:55

0 Answers0