def resize_image(fullfile,fullfile_resized,_megapixels):
logger.debug("<STR_LIT>"%(fullfile,_megapixels))<EOL>img = Image.open(fullfile)<EOL>width,height=img.size<EOL>current_megapixels=width*height/(<NUM_LIT>**<NUM_LIT:20>)<EOL>new_width,new_height=resize_compute_width_height(fullfile,_megapixels)<EOL>if not new_width:<EOL><INDENT>logger.debug("<STR_LIT>"%(fullfile))<EOL>return False<EOL><DEDENT>logger.info("<STR_LIT>"%(fullfile,current_megapixels,_megapixels,width,height,new_width,new_height))<EOL>imageresize = img.resize((new_width,new_height), Image.ANTIALIAS)<EOL>imageresize.save(fullfile_resized, '<STR_LIT>')<EOL>if not update_exif_GEXIV2(fullfile,fullfile_resized):<EOL><INDENT>return False<EOL><DEDENT>return True<EOL>
Resizes image (fullfile), saves to fullfile_resized. Image
    aspect ratio is conserved, will be scaled to be close to _megapixels in 
    size. Eg if _megapixels=2, will resize 2560x1920 so each dimension
    is scaled by ((2**(20+1*MP))/float(2560*1920))**2