参考
http://www.java3z.com/cwbwebhome/article/article5a/571.html
public int getPicWidthOrHeight(String photo, String flag) {
try {
File _file = new File(photo);
Image src = javax.imageio.ImageIO.read(_file);
int wideth = src.getWidth(null);
int height = src.getHeight(null);
if("W".equalsIgnoreCase(flag)){
return wideth;
}else{
return height;
}
} catch (Exception e) {
// TODO: handle exception
return 0;
}
}