Код: Выделить всё
$image = $_FILES['uploaded_file'];
var_dump($image);
$oldw = imagesx($image);
$oldh = imagesy($image);
$imagedetails = getimagesize($image);
$width = "width".$imagedetails[0];
$height = "height".$imagedetails[1];
$neww = 512;
$newh = 512;
$temp = imagecreatetruecolor($neww, $newh);
imagecopyresampled($temp, $image, 0, 0, 0, 0, $neww, $newh, $oldw, $oldh);
//Error messages:
imagesx() expects parameter 1 to be resource
imagesy() expects parameter 1 to be resource
getimagesize() expects parameter 1 to be string
//Here is what the var_dump of image
array(5) {
["name"]=>
string(14) "image.png"
["type"]=>
string(24) "application/octet-stream"
["tmp_name"]=>
string(14) "/tmp/phpLlon22"
["error"]=>
int(0)
["size"]=>
int(2743914)
Подробнее здесь: https://stackoverflow.com/questions/793 ... ng-with-gd
Мобильная версия