if(!img_dir.mkdirs())
throw new IOException("Cannot make directory: " + img_dir.getParent());
}
}
//�ж�ͼ��Ĵ�С��������Ҫ���е���
BufferedImage orig_portrait = (BufferedImage)ImageIO.read(pFile.getInputStream());
int preview_width = Math.min(PORTRAIT_WIDTH, orig_portrait.getWidth());
int preview_height= Math.min(PORTRAIT_HEIGHT,orig_portrait.getHeight());
if(preview_width != orig_portrait.getWidth() || preview_height!=orig_portrait.getHeight()){
ImageUtils.createPreviewImage(pFile.getInputStream(), img_path,
preview_width, preview_height);
}
else{
ImageUtils.writeToFile(pFile, img_path);