|
@@ -1,5 +1,6 @@
|
|
|
package com.fdkankan.common.util;
|
|
|
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.core.io.ClassPathResource;
|
|
|
|
|
|
import javax.imageio.ImageIO;
|
|
@@ -9,6 +10,7 @@ import java.awt.image.BufferedImage;
|
|
|
import java.io.File;
|
|
|
import java.io.IOException;
|
|
|
|
|
|
+@Slf4j
|
|
|
public class LogoConfig {
|
|
|
/**
|
|
|
* 设置 logo
|
|
@@ -33,7 +35,12 @@ public class LogoConfig {
|
|
|
ClassPathResource classPathResource = new ClassPathResource("static/img/logo.jpg");
|
|
|
logoPath =classPathResource.getURL().getPath();
|
|
|
}
|
|
|
- BufferedImage logo = ImageIO.read(new File(logoPath));
|
|
|
+ BufferedImage logo = null;
|
|
|
+ try {
|
|
|
+ BufferedImage logo = ImageIO.read(new File(logoPath));
|
|
|
+ }catch (IOException e){
|
|
|
+ log.info("读取图片流失败,path="+ logoPath, e);
|
|
|
+ }
|
|
|
|
|
|
//开始绘制图片
|
|
|
g2.drawImage(logo,matrixWidth/5*2,matrixHeigh/5*2, matrixWidth/5, matrixHeigh/5, null);//绘制
|