views:

31

answers:

2

Hello!

If one were to create a site where users could upload images in various formats (JPG, PDF, etc.) and process that image into one monochrome GIF copy and a PDF, what would be the best infrastructure for doing so?

I know that there is already a question about image processing infrastructure, but I would like to know what specific method would be recommended for PHP.

Should I script a PHP background job? Should I store the list of images to process in a database? Should the processing of the images take place in the uploading PHP script?

Thanks in advance for any help.

A: 

I would store the uploaded images into a filesystem, not database, and have an external/standalone component take care of the image processing. That component could be anything from a Java to Perl application, not necessarily php.

Raj
So you would opt for a long-running process in the background looking through the filesystem for images to process?
Jonathan Chan
Yep. It decouples the uploading part from any processing of the images.
Raj
A: 

It's pretty easy to call an ImageMagick binary to do things to an image. And modern servers are more than fast enough to do it as part of the post-upload processing before returning the success page to the end-user. I work on a commercial site that does exactly that for user uploads and we've never had a problem.

staticsan
Very interesting. Thanks, I'll run some tests on this, then get back with a reply.
Jonathan Chan