Php-questions about how the Android client transfers images to the server and generates thumbnails

Source: Internet
Author: User
I used to generate a thumbnail on the Android client and then send it to the server. now I use php to generate a thumbnail on the server. this experiment is successful. However, if it is an image sent from the client, only source images can be saved, and Thumbnails cannot be generated on the server. I made a judgment, because we need to use $ src_imageImageCreateFromBMP ($ uploads_dir. $ uploadname) to call the source image. Is it because when the client sends the source image to the server, the original image is called before being uploaded, causing an error? However, I have added an if (move_uploaded_file ($ _ FILES [& #39; imag php

I used to generate a thumbnail on the Android client and then send it to the server. now I use php to generate a thumbnail on the server. this experiment is successful. However, if it is an image sent from the client, only source images can be saved, and Thumbnails cannot be generated on the server. I made a judgment, because $ src_image = ImageCreateFromBMP ($ uploads_dir. $ uploadname) to call the source image. Is it because when the client sends the source image to the server, the original image is called before being uploaded, causing an error? However, I have added an if (move_uploaded_file ($ _ FILES ['image'] ['tmp _ name'], $ uploads_dir. $ uploadname) to judge it. Then I added a while loop while (1)
{
$ Src_image = ImageCreateFromJPEG ($ uploads_dir. $ uploadname );
}
If ($ src_image)
{
Break;
}, That is, the source image is continuously called until it is successful, but it still does not work. There is no program error, because you have written a form on the local machine for submission to generate a thumbnail. Thank you!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.