/**
* 图片像素判断
*
* @param imgPath 图片地址
* @return
* @throws IOException
*/
public static boolean judgeImgPixel(String imgPath) throws IOException {
BufferedImage bi = ImageIO.read(new FileInputStream(imgPath));
int width = bi.getWidth();
int height = bi.getHeight();
if (width < 128 || height < 128 || width > 4096 || height > 4096) {
return false;
}
return true;
}
java--判断图片的像素
【勤则百弊皆除】