I am not sure if this really is this difficult, or if I can't come up with the right search terms, but an ImageCache use case has me stumped right now.
I have a theme where I need to proportionally scale images to a max height and width (ie, a bounding box), and if possible center the image on a colored background.
For example, lets say I have a 1024x768 image and max size is 500x400. I need ImageCache to make a 500x375 image. The action would need to work for arbitrary image sizes, as the input varies widely.
Non-proportional scaling and/or cropping is not an option due to usage rights.
What is the best option here? I have gone through module that add additional ImageCache actions, but did not see any that did this. I suspect I could use ImageMagick Raw Effect but I would rather not rely on a particular toolkit, as I may need a portable solution.