Skip to content

Commit

Permalink
♻️ refactor/#75 : qr 생성용 이미지 file -> url로 변경
Browse files Browse the repository at this point in the history
Signed-off-by: EunJiJung <[email protected]>
  • Loading branch information
bianbbc87 committed Nov 22, 2024
1 parent 143e07b commit 29f56ad
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/main/java/com/daon/onjung/core/utility/QrUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.IOException;
import java.net.URL;
import java.util.HashMap;
import java.util.Map;

Expand Down Expand Up @@ -69,7 +70,7 @@ public byte[] generateQrCodeImageByte(String id) {
BufferedImage qrCodeImage = MatrixToImageWriter.toBufferedImage(bitMatrix, matrixToImageConfig);

// 배경 이미지 로드 (디자인 파일 경로) - 배경이 없으면 로고 이미지가 흰색으로 안 보이는 이슈 있음.
BufferedImage originalBackgroundImage = ImageIO.read(new File(bg_img_url));
BufferedImage originalBackgroundImage = ImageIO.read(new URL(bg_img_url));

// 배경 이미지를 QR 코드 크기로 리사이즈
BufferedImage backgroundImage = new BufferedImage(qrSize, qrSize, BufferedImage.TYPE_INT_ARGB);
Expand All @@ -78,7 +79,7 @@ public byte[] generateQrCodeImageByte(String id) {
bgGraphics.dispose();

// 로고 이미지 로드
BufferedImage logoImage = ImageIO.read(new File(logo_img_url));
BufferedImage logoImage = ImageIO.read(new URL(logo_img_url));

// 배경 이미지 위에 QR 코드 합성
BufferedImage combinedImage = new BufferedImage(qrSize, qrSize, BufferedImage.TYPE_INT_ARGB);
Expand Down

0 comments on commit 29f56ad

Please sign in to comment.