Hello,
I guess that you are about to setting up those proportions in the transformation, right? Moreover, you probably have the Attachment GUID of the image. In this case you will be able to develop a
custom function to this transformation where you'll obtain an Attachment Info object which contains the real AttachmentImageWidth and AttachmentImageHeight values. Once you have the sizes of the image, you can write a script which will count another size according to the given width or height. You'll return both values back and you can pass them to the GetImage function.
You might find helpful our API reference:
http://devnet.kentico.com/downloads/kenticocms_api.zip.
Hope the above description makes sense and suits your needs.
Best regards
Ondrej Vasil