﻿function resizeImage(img, fixedw) {
    var ratio = img.height / img.width;

    if (img.width > fixedw) {
        img.height = fixedw / img.width * img.height;
        img.width = fixedw;
    }
    else if (img.width < fixedw) {
        img.height = img.width / fixedw * img.height;
        img.width = fixedw;
    }
}
