function resizeImg2(img, height, width)
{
        if ((width / height) > (img.width / img.height)) 
        {
            img.height = height;
            img.width = img.width * img.height / height;
        }
        else 
        {
            img.width = width ;
            img.height = img.height * width / img.width;
        }
}
