0

I have an Android application that provides image upload functionality. When a user selects a photo the app initializes a php script on a remote server - while the image is uploading there is a progress dialog giving feedback to the user. The upload script is performed in an AsyncTask.

Currently the php processing script pseudoprocess is:

do some house keeping
upload image
image modifications (thumbnails, rotate)
send out push notifications
exit

Upon exit, the UI is freed up and the user has access to the uploaded image.

My question is in my script can/should I be doing the image modifications and push notifications outside this script? And if so how? In the Android Java I would start a background task, but is there someway to do this in PHP - and I don't mean by calling another script separately or cron jobbing something.

I mean something like:

do some housekeeping
upload image
php call background task for modifications
php call background task for push
exit

So in that example the user interface would be finished processing, but the server may still be doing some stuff on the image.

bMon
  • 962
  • 4
  • 15
  • 33
  • what do the modifications do? PHP has a few image processing libraries (http://www.php.net/manual/en/refs.utilspec.image.php), but these tend to be memory intensive. Is this part something you should have the client do instead, and have PHP just do minor cleanup or validation on the final uploaded image only if necessary? – bob-the-destroyer Feb 29 '12 at 01:18
  • @bob-the-destroyer Just certain things with the PHP GD Library, but the push notifications are what really slow it down. But I guess I should look into having the image mod stuff done on the client side.. – bMon Feb 29 '12 at 03:27

0 Answers0