I want to read out the width (orgWidth) of an image specified by an url within a for-loop, calculate its new width (calcWidth) for a height of 480px.
for (var i=1; i <= item.length; i++) {
url = document.images[i].rsc;
orgWidth = some-fancy-thing-that-reads-the-width;
orgHeight = some-fancy-thing-that-reads-the-height;
factor = orgHeight / 480 // 1400 / 480 = 2.916
calcWidth = orgWidth / factor // 1000 / 2.916 = 342.935
document.images[i].width = calcWidth;
}
Page I need it for: http://foto.hendrik-schicke.de/index.php/people