-
Notifications
You must be signed in to change notification settings - Fork 3
fix: 배너 이미지 한글 깨짐 수정 및 재생성 API 추가 #409
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,6 +5,7 @@ | |
| import java.awt.Color; | ||
| import java.awt.Font; | ||
| import java.awt.FontMetrics; | ||
| import java.awt.GraphicsEnvironment; | ||
| import java.awt.Graphics2D; | ||
| import java.awt.RenderingHints; | ||
| import java.awt.font.TextAttribute; | ||
|
|
@@ -190,13 +191,18 @@ private Font createStyledFont(Font baseFont, int style, float size, float tracki | |
|
|
||
| private Font loadFont(String path) { | ||
| try (InputStream fontStream = getClass().getClassLoader().getResourceAsStream(path)) { | ||
| if (fontStream != null) { | ||
| return Font.createFont(Font.TRUETYPE_FONT, fontStream); | ||
| if (fontStream == null) { | ||
| throw new BannerImageGenerationException(); | ||
| } | ||
| Font font = Font.createFont(Font.TRUETYPE_FONT, fontStream); | ||
| GraphicsEnvironment.getLocalGraphicsEnvironment().registerFont(font); | ||
| return font; | ||
| } catch (BannerImageGenerationException e) { | ||
| throw e; | ||
| } catch (Exception e) { | ||
| log.warn("커스텀 폰트 로드 실패 ({}), 기본 폰트 사용: {}", path, e.getMessage()); | ||
| log.error("커스텀 폰트 로드 실패 ({}): {}", path, e.getMessage()); | ||
| throw new BannerImageGenerationException(); | ||
|
Comment on lines
+200
to
+204
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 예외 로깅에서 스택트레이스가 유실됩니다. 현재는 메시지만 기록되어 폰트 로드 실패 원인 추적이 어렵습니다. 동시에 재던지기용 수정 예시- } catch (BannerImageGenerationException e) {
- throw e;
- } catch (Exception e) {
- log.error("커스텀 폰트 로드 실패 ({}): {}", path, e.getMessage());
+ } catch (Exception e) {
+ if (e instanceof BannerImageGenerationException) {
+ throw (BannerImageGenerationException) e;
+ }
+ log.error("커스텀 폰트 로드 실패 ({})", path, e);
throw new BannerImageGenerationException();
}🤖 Prompt for AI Agents |
||
| } | ||
| return new Font("SansSerif", Font.BOLD, 36); | ||
| } | ||
|
|
||
| private byte[] toPngBytes(BufferedImage image) { | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
POST 재생성 엔드포인트의 상태 코드는 201로 맞춰주세요.
Line [56]이
204 NO_CONTENT로 선언되어 있어 저장소 규칙과 충돌합니다.제안 diff
As per coding guidelines,
HTTP status codes: POST returns 201 Created, GET returns 200 OK, PUT/PATCH/DELETE returns 204 No Content규칙을 따라야 합니다.📝 Committable suggestion
🤖 Prompt for AI Agents