I am probably being very very stupid. But i cant get this to work for my life. 
I am trying to set the imgWidth to the same width as the image width of the file (pic_real_width). 
function calculate() {
    var pic_real_width, pic_real_height;
    $("<img/>").attr("src", $("#pp_photo_popUp")[0].src).load(function() {
        pic_real_width = this.width;   // Note: $(this).width() will not
        pic_real_height = this.height; // work for in memory images.
    });
    var imgWidth = 
}
All in all I am trying to make a function to get the real dimensions of a file on the hard disk.
 
     
    