I was not clear on what I was saying, I apologize.
For my application, I wanted to generate the image and then pass the URL to the user. Your JS array will absolutely work for my needs. I just need to grab the image sizes and call getImageCacheFilename() for each image size. After that, I can rehook the onclick function for the radials (or selector). My problem is solved.
As to my original question of having i.php having an option to return a URL to a cached image:
Where this would come in handy would be in applications like viewer_size_image. Currently, after the swap occurs, there is a several second delay before the browser loads the new image. If you're upsizing (say from 100px to 500px), you get the 100px image until the 500px image is generated and then downloaded by the browser.
My thought was that if i.php could notify the browser when it was finished generating the image, that would cut out the delay where a user sees a terrible looking up-scaled image. To me, this is a better user experience than seeing the up-scaled image (even if it is only for a short time). To really make it complete, the image could be swapped out for a loading graphic until i.php completed.
If you think the idea is ridiculous, you can stop reading here. I agree, there is more than one way to skin a cat and my way of skinning isn't necessarily any better.
In order to get this functionality, one currently has to make a jQuery ajax() to call i.php.
The way I read lines 225 & 226 of i.php, i.php always exits with a 301 redirect (except in debug mode). Because XmlHttpRequest (XHR) handles 301 redirects by following them without notifying the browser. This means that the image gets returned to the DOM [b]as data[/b].
This is problematic for several reasons:
[list]
[*]The image, as data isn't useful and gets tossed immediately
[*]You could end up transferring several megabytes of useless data
[*]
[*]The browser javascript engine will end up with the image as data, which can cause the browser to choke - especially on low-memory machines like netbooks
[/list]
What I was suggesting would not be to functionally change i.php, but to have i.php exit without redirecting when called with a specific argument (similar to the way debug currently works). Since we would already be forcing i.php to run, it might as well output something and my thought was to have i.php exit by outputting $path (from line 204).
I hope that this makes much better sense to you.