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

添加水印图片

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