def resize_compute_width_height(fullfile,_megapixels):
img = Image.open(fullfile)<EOL>width,height=img.size<EOL>current_megapixels=width*height/(<NUM_LIT>**<NUM_LIT:20>)<EOL>scale=sqrt(_megapixels/float(current_megapixels))<EOL>logger.debug('<STR_LIT>'%(scale))<EOL>if scale>= <NUM_LIT:1.0>:<EOL><INDENT>logger.warning('<STR_LIT>',<EOL>current_megapixels,_megapixels);<EOL>return width,height<EOL><DEDENT>new_width=int(width*scale)<EOL>new_height=int(height*scale)<EOL>return new_width,new_height<EOL>
Given image file and desired megapixels,
    computes the new width and height