Commit 7c1abef7 authored by 赵啸非's avatar 赵啸非

添加水印图片

parent e6ed173a
package com.mortals.xhx.common.utils; package com.mortals.xhx.common.utils;
import com.mortals.xhx.module.record.web.ApplyLogController; import com.mortals.xhx.module.record.web.ApplyLogController;
import lombok.extern.slf4j.Slf4j;
import javax.imageio.ImageIO; import javax.imageio.ImageIO;
import javax.swing.*; import javax.swing.*;
...@@ -10,6 +11,7 @@ import java.io.File; ...@@ -10,6 +11,7 @@ import java.io.File;
import java.io.FileOutputStream; import java.io.FileOutputStream;
import java.io.OutputStream; import java.io.OutputStream;
@Slf4j
public class WatermarkImgUtils { public class WatermarkImgUtils {
...@@ -68,11 +70,11 @@ public class WatermarkImgUtils { ...@@ -68,11 +70,11 @@ public class WatermarkImgUtils {
}*/ }*/
g.dispose();// 释放资源 g.dispose();// 释放资源
// 输出图片 // 输出图片
log.info("生成水印图片路径:{}",tarImgPath);
outImgStream = new FileOutputStream(tarImgPath); outImgStream = new FileOutputStream(tarImgPath);
ImageIO.write(bufImg, fileExt, outImgStream); ImageIO.write(bufImg, fileExt, outImgStream);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); log.error("生成水印图片异常:",e);
e.getMessage();
} finally{ } finally{
try { try {
if(outImgStream != null){ if(outImgStream != null){
......
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