php-关于安卓客户端向服务器传送图片并生成缩略图的问题

WBOY
Release: 2016-06-02 11:34:19
Original
1279 people have browsed it

php

我本来是在安卓客户端生成缩略图的,然后和原图一起发送到服务器,现在改用在服务器端用php生成缩略图,本机实验成功,但是如果是客户端传来的图片,只能保存原图,不能用服务器生成缩略图。我判断了一下,因为生成缩略图要用$src_image=ImageCreateFromBMP($uploads_dir.$uploadname)来调用原图,是不是因为客户端向服务器端发送时,原图还未上传好就调用原图引发错误了?可是我已经加了一个if(move_uploaded_file($_FILES['image']['tmp_name'], $uploads_dir.$uploadname))来进行判断了啊。然后我又加了一个while循环while(1)
{
$src_image=ImageCreateFromJPEG($uploads_dir.$uploadname);
}
if($src_image)
{
break;
}},就是说不断调用原图,直到成功,可是还是不行。程序无错误,因为自己在本机编写了一个表单进行提交可以生成缩略图。请大家支招,谢谢

Related labels:
php
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template