调整远程映像的大小并将其保存到服务器


Resizing remote images and saving it to the server

所以我利用了这个指南,并能够想出这个:

<html>
<head></head>
<body>
<form action="process.php" method="get">
<input type="text" name="image"/>
<input type="submit"/>
</form>
</body>
</html>

和process.php我想到了:

 <?php
   include("SimpleImage.php");
   $imgName = $_GET["image"]; //assuming you used GET request and form submits to http://url/script.php?image=something.jpg
   $image = new SimpleImage();
   $image->load($imgName);
   $image->resizeToWidth(250);
   $image->save($imgName);
   echo $imgName;
?>

可是出了什么事。这不是保存图像:(我完全是一个PHP新手,所以我希望你能给一些新手友好的解决方案。谢谢你

检查您的文件夹/文件权限是否可以在该目录上读/写。如果您没有设置保存新图像的路径,通常它会写到process.php所在的同一个目录。