Browse Source

// test

release_toaliyun_real
xhxu 3 years ago
parent
commit
a3401bdff0
1 changed files with 7 additions and 3 deletions
  1. +7
    -3
      mallinkBApi/src/main/java/com/iformall/utils/ImgYwsqhUtil.java

+ 7
- 3
mallinkBApi/src/main/java/com/iformall/utils/ImgYwsqhUtil.java View File

@@ -17,6 +17,7 @@ import java.io.File;
import java.io.InputStream;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Date;
import java.util.Locale;

public class ImgYwsqhUtil {
@@ -36,12 +37,13 @@ public class ImgYwsqhUtil {
boolean isSeal,String merchant_name){

try {
logger.info("starttime1----"+new Date().getTime());
// InputStream backImgUrl = ImgYwsqhUtil.class.getClassLoader().getResourceAsStream(imgTempPath);
ClassPathResource resource = new ClassPathResource(imgTempPath);
InputStream backImgUrl = resource.getInputStream();
logger.info("starttime2----"+new Date().getTime());
BufferedImage backImg = ImageIO.read(backImgUrl);
logger.info("starttime3----"+new Date().getTime());
// backImgUrl.close();
Graphics g = backImg.getGraphics();

@@ -107,9 +109,11 @@ public class ImgYwsqhUtil {

//调这个方法就是开始这个整合 (可以多张图片,多个文字整合成一张图片,只有把他们放在这方法里面就行)
g.dispose();
logger.info("starttime4----"+new Date().getTime());
ByteArrayOutputStream out = new ByteArrayOutputStream();
ImageIO.write(backImg, "png", out);
logger.info("starttime5----"+new Date().getTime());
byte[] bytes = out.toByteArray();
// out.close();
return bytes;


Loading…
Cancel
Save