I have a script that processes a live image from a webcam, cropping it and delivering it to the user. The webcam ftp's an image called "ftp.jpg" every so often, and when the user loads the "live image" page, the script opens the ftp-ed image and creates and saves a new jpeg with the cropping applied.
The problem seems to be, if the user runs the script and the new image hasn't finished ftp-ing in, the resulting cropped image is black - nothing.
Is there some way to check that the image is "complete" before running the script? If not, any suggestions for avoiding trying to process an incomplete image?
Thanks!