I'm looking to resize an uploaded image, and I'm sure I'm not the first to be asking question about this. So any tips would be great!
Thanks.
Moderator: General Moderators
Yeah, that's kinda what I thought.VladSun wrote:A look at the PHP manuals shows that the only difference is this sentence:
"smoothly interpolating pixel values so that, in particular, reducing the size of an image still retains a great deal of clarity"
So, my guess is that imagecopyresampled() would give better image quality.
I can't imagine how an image resizing can be done without any interpolation, but maybe imagecopyresampled() uses higher interpolation order than imagecopyresized().
Code: Select all
move_uploaded_file($_FILES['image']['tmp_name'],"/LOCATION/".$_FILES['image']['name']);
http://www.phpgd.com/articles.php?article=8&page=1http://www.phpgd.com/articles.php?article=8&page=1 wrote:There is also a quicker option to resize the image. PHP's imagecopyresized() function is a lot faster, and less CPU intensive than imagecopyresampled(). However, it uses a basic 'Nearest Neighbour' algorithm so the results look blocky and poor quality.
Why do I have to use move_uploaded_file() in particular? Isn't there another function that would take a newly created image and save it to a directory?pickle wrote: 2) move_uploaded_file() only works on newly uploaded files. You want to use the rename() function on files that haven't been newly uploaded.