adamdbradley/foresight.js — pull request #18 by jmuthad (2012-04-25 15:29:18+00:00)
Title: Aspect ratio work

Hi Adam,

This pull request shows two things. First I added /demos/parent-percentage-unknown-image-width.html (although didn't add to the index until I got your opinion on it). If you go back in the commit history this will show a way to get a request based on a percent without knowing the width/height but I didn't like it because the code pretty much ignores these values if you don't use the height in the dynamic request (i.e. I set the height/width to 1/1 and it worked as if I hadn't specified it) yet if you use wrong values the debug output looks wrong.

Later in the second commit that is in this pull request I tried out adding an aspect ratio attribute that could be used instead of the height and width. At the very least I think that value would be useful although I'm not sure if you will like my "auto" option for people such as me that don't know either the height and are going to let the height be simply the natural height. Let me know your thoughts on this and I can create some more demos to demonstrate it.

Thanks,
Thad