Commit e4d77b88 by 田超

fix bug

parent bdd911dc
...@@ -148,16 +148,19 @@ public class PictureUtil { ...@@ -148,16 +148,19 @@ public class PictureUtil {
public static Color getImagePixel(String imgFile) { public static Color getImagePixel(String imgFile) {
BufferedImage bi = null; BufferedImage bi = null;
Color imagePixel;
try { try {
if(imgFile.contains("http")){ if(imgFile.contains("http")){
bi = ImageIO.read(new URL(imgFile)); bi = ImageIO.read(new URL(imgFile));
}else{ }else{
bi = ImageIO.read(new File(imgFile)); bi = ImageIO.read(new File(imgFile));
} }
imagePixel = getImagePixel(bi);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); imagePixel = Color.CYAN;
LOGGER.error("生成图片失败,图片="+imgFile+","+e.getMessage(),e);
} }
return getImagePixel(bi); return imagePixel;
} }
public static String toBrowserHexValue(int number) { public static String toBrowserHexValue(int number) {
......
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