Search code examples
phpimage-processinginfrastructure

Best method for processing upload user images


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.


Solution

  • 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.