I was recently faced with the same problem in two different projects: forcing the creation of an image derivative with imagecache so that it is available in the submit handler of the same form in which the image was uploaded. By default, imagecache generates images on demand triggered by an HTTP request, which is ideal for most cases. However, this design doesn't make it possible to trigger the generation of images programmatically, which is why I created the following code snippet.
Read more