[eluser]Colin Williams[/eluser]
I think it's better, if you are concerned about doing them in a string of processes like that, to only create the image when it is requested. Here's a basic rundown of how to do this:
1. Designate a public directory where root (full-size) images will be stored. Let's assume it's /images/
2. Employ mod_rewrite rules on that directory whereby files that do exist get served by Apache and files that do not exist get served by an Image controller.
3. Write the Image controller to catch these exceptions. What you want to do with this is use the URI segments as instructions for processing the image, then
store the new image at a location accessible via the exact same URI. After you generate the new image, either serve it dynamically from that controller or redirect to the new file. If you cannot process the image, call show_404()
For example, the file /images/frog.jpg exists. The yet-to-exist thumbnail gets requested at /images/thumbnail/frog.jpg. Since this file doesn't exist, our Images controller is invoked to serve the request. The Images controller processes /images/frog.jpg based on the "thumbnails" preset and writes the file to /images/thumbnail/frog.jpg and then either serves it or redirects to it. Next time /images/thumbnail/frog.jpg is requested, Apache will find that file on the server and serve it per usual. The process only runs once, and only when it must.