Image Resizer Script
Automatic Image Resizer: JavaScript function fixImgs()
This script resizes all images that exceed the preset maximum width (360 pixels for this template) while maintaining aspect ratio. I created it to prevent very wide pictures from breaking the column style.
The picture below measures 432 x 324 pixels at source. If left unchecked, the body of this post will stretch beyond this column of 425 pixels. The script reduced the image to 360 x 270 pixels, thus preserving the column width specification.

This script resizes all images that exceed the preset maximum width (360 pixels for this template) while maintaining aspect ratio. I created it to prevent very wide pictures from breaking the column style.
The picture below measures 432 x 324 pixels at source. If left unchecked, the body of this post will stretch beyond this column of 425 pixels. The script reduced the image to 360 x 270 pixels, thus preserving the column width specification.
Image Resizer code below:
View template code with resizer script (opens new window)
<script type="text/javascript"><!--
function fixImgs() {
var maxW=360;
for (i=0; i < document.images.length; i++) {
w=document.images[i].width;
h=document.images[i].height;
if (w>maxW) {
f=1-((w-maxW)/w);
document.images[i].width=(w*f);
document.images[i].height=(h*f);
}
}
}
--></script>
View template code with resizer script (opens new window)