Commit ea211445 by 田超

fix bug for color

parent cae5276b
......@@ -38,7 +38,9 @@ public class PictureUtil {
public static Color getImagePixel(BufferedImage bi) {
if(bi.getWidth()*bi.getHeight()>10000) {
BufferedImage pic1 = new BufferedImage(60, 60, BufferedImage.TYPE_3BYTE_BGR);
BufferedImage pic1 = new BufferedImage(350, 350, BufferedImage.TYPE_3BYTE_BGR);
Graphics graphics = pic1.getGraphics();
graphics.drawImage(bi.getScaledInstance(350,350,Image.SCALE_SMOOTH),0,0,null);
bi = pic1;
}
int width = bi.getWidth();
......@@ -161,7 +163,7 @@ public class PictureUtil {
}
imagePixel = getImagePixel(bi);
} catch (Exception e) {
imagePixel = Color.CYAN;
imagePixel = Color.gray;
LOGGER.warn("生成图片失败,图片="+imgFile+","+e.getMessage(),e);
}
return imagePixel;
......
This diff is collapsed. Click to expand it.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment