Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking β€œSign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

πŸ”¨ Refactor/#75 : qr μƒμ„±μš© 이미지 file -> url둜 λ³€κ²½ #76

Merged
merged 1 commit into from
Nov 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
@@ -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;

@@ -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);
@@ -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);