Skip to content

fix: alpine 환경에서도 webp 변환이 가능하도록 scrimage 기반 인코더로 교체#388

Merged
dh2906 merged 7 commits intodevelopfrom
fix/image-convert-library
Mar 13, 2026
Merged

fix: alpine 환경에서도 webp 변환이 가능하도록 scrimage 기반 인코더로 교체#388
dh2906 merged 7 commits intodevelopfrom
fix/image-convert-library

Conversation

@dh2906
Copy link
Contributor

@dh2906 dh2906 commented Mar 13, 2026

🔍 개요

  • close #이슈번호

🚀 주요 변경 내용

  • Alpine 환경에서 WEBP writer 탐색 실패로 이미지 업로드 API가 ILLEGAL_STATE로 실패하던 문제를 해결했습니다.

  • 이미지 변환 경로를 ImageIO 기반 writer 탐색에서 scrimage 기반 WEBP 인코딩으로 교체하고, 예외 원인 로그를 보강했습니다.

  • 관련 작업은 아니지만 이전 PR에서 미처 해결하지 못한 포맷팅 관련 문제도 해결했습니다.


💬 참고 사항


✅ Checklist (완료 조건)

  • 코드 스타일 가이드 준수
  • 테스트 코드 포함됨
  • Reviewers / Assignees / Labels 지정 완료
  • 보안 및 민감 정보 검증 (API 키, 환경 변수, 개인정보 등)

@dh2906 dh2906 self-assigned this Mar 13, 2026
@coderabbitai
Copy link

coderabbitai bot commented Mar 13, 2026

Warning

Rate limit exceeded

@dh2906 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 7 minutes and 2 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: e97f9a98-2266-4094-8b72-b30e1464060a

📥 Commits

Reviewing files that changed from the base of the PR and between ff1d0fa and 048f54d.

📒 Files selected for processing (1)
  • scripts/code-formatting.sh
📝 Walkthrough

Walkthrough

WebP 이미지 변환 라이브러리를 TwelveMonkeys에서 Scrimage로 교체하고, 코드 포맷팅 스크립트의 경로 해석을 개선하며, 예외 처리 및 로깅을 강화합니다.

Changes

Cohort / File(s) Summary
WebP 변환 라이브러리 업그레이드
build.gradle
TwelveMonkeys의 imageio-webp를 Scrimage 라이브러리(scrimage-core, scrimage-webp v4.3.2)로 교체하여 WebP 변환 방식 변경
이미지 변환 로직 리팩토링
src/main/java/.../ImageConversionService.java
ImageIO 기반의 WebP 인코딩을 Scrimage의 AwtImage 및 WebpWriter 기반으로 변경. 품질 스케일 변환 헬퍼 메서드(toWebpQualityPercent) 추가
예외 처리 개선
src/main/java/.../GlobalExceptionHandler.java
handleIllegalStateException 메서드에 IllegalStateException 매개변수 추가하여 예외 로깅 기능 구현
경로 해석 강화
scripts/code-formatting.sh
상대 경로 할당을 realpath로 감싸 절대 경로 해석을 보장하고 일관성 개선

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested labels

버그

Poem

🐰 스크림이지로 갈아탄 우리의 이미지,
웹피 변환은 이제 더 가볍네요!
절대 경로로 확실히 찾고,
예외는 이제 목소리를 내며,
코드의 여정이 더욱 명확해졌어요! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed PR 제목이 주요 변경 사항인 scrimage 기반 WEBP 인코더 교체와 Alpine 환경 지원을 명확히 설명하고 있습니다.
Description check ✅ Passed PR 설명이 변경사항과 관련이 있으며 Alpine 환경에서의 WEBP 변환 문제 해결, ImageIO에서 scrimage로의 마이그레이션, 로깅 개선 등의 주요 변경 내용을 포함하고 있습니다.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/image-convert-library
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@dh2906 dh2906 added the 버그 정상적으로 동작하지 않는 문제 상황 관련 이슈입니다. label Mar 13, 2026
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@scripts/code-formatting.sh`:
- Around line 26-31: The script uses the non-portable realpath command when
resolving files (see resolved_file assignments in resolve_target_java_file)
which fails on macOS/older Linux and the caller silences failures with "||
true"; replace the realpath usage with a POSIX-safe resolution (compute
dirname+pwd and basename) when setting resolved_file for input_file,
invocation_dir/$input_file and repo_root/$input_file, and remove the "|| true"
suppression so failures propagate (or explicitly check and emit an error) to
avoid silently skipping files.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: f4584324-cb7e-46c8-b703-e76ffeb1aee8

📥 Commits

Reviewing files that changed from the base of the PR and between 91813c4 and ff1d0fa.

📒 Files selected for processing (4)
  • build.gradle
  • scripts/code-formatting.sh
  • src/main/java/gg/agit/konect/domain/upload/service/ImageConversionService.java
  • src/main/java/gg/agit/konect/global/exception/GlobalExceptionHandler.java
📜 Review details
🧰 Additional context used
📓 Path-based instructions (2)
**/*

⚙️ CodeRabbit configuration file

**/*: 공통 리뷰 톤 가이드:

  • 모든 코멘트는 첫 줄에 [LEVEL: ...] 태그를 포함한다.
  • 과장된 표현 없이 사실 기반으로 작성한다.
  • 한 코멘트에는 하나의 이슈만 다룬다.
  • 코드 예시가 필요하면 최소 수정 예시를 제시한다.
  • 가독성/단순화/확장성 이슈를 발견하면 우선순위를 높여 코멘트한다.

Files:

  • scripts/code-formatting.sh
  • src/main/java/gg/agit/konect/domain/upload/service/ImageConversionService.java
  • build.gradle
  • src/main/java/gg/agit/konect/global/exception/GlobalExceptionHandler.java
src/main/java/**/*.java

⚙️ CodeRabbit configuration file

src/main/java/**/*.java: 아래 원칙으로 리뷰 코멘트를 작성한다.

  • 코멘트는 반드시 한국어로 작성한다.
  • 반드시 수정이 필요한 항목만 코멘트로 남기고, 단순 취향 차이는 지적하지 않는다.
  • 각 코멘트 첫 줄에 심각도를 [LEVEL: high|medium|low] 형식으로 반드시 표기한다.
  • 심각도 기준: high=운영 장애 가능, medium=품질 저하, low=개선 권고.
  • 각 코멘트는 "문제 -> 영향 -> 제안" 순서로 3문장 이내로 간결하게 작성한다.
  • 가능하면 재현 조건 및 실패 시나리오도 포함한다.
  • 제안은 현재 코드베이스(Spring Boot + JPA + Flyway) 패턴과 일치해야 한다.
  • 보안, 트랜잭션 경계, 예외 처리, N+1, 성능 회귀 가능성을 우선 점검한다.
  • 가독성: 변수/메서드 이름이 의도를 바로 드러내는지, 중첩과 메서드 길이가 과도하지 않은지 점검한다.
  • 단순화: 불필요한 추상화, 중복 로직, 과한 방어 코드가 있으면 더 단순한 대안을 제시한다.
  • 확장성: 새 요구사항 추가 시 변경 범위가 최소화되는 구조인지(하드코딩 분기/값 여부 포함) 점검한다.

Files:

  • src/main/java/gg/agit/konect/domain/upload/service/ImageConversionService.java
  • src/main/java/gg/agit/konect/global/exception/GlobalExceptionHandler.java
🔇 Additional comments (1)
scripts/code-formatting.sh (1)

45-45: [LEVEL: nitpick]

LGTM - git ls-files 결과에 대한 realpath 적용

git ls-files로 찾은 파일에 대해 $repo_root를 붙여 절대 경로로 변환하는 방식이 올바릅니다. 이전 브랜치들과 일관성 있게 처리됩니다.

@dh2906 dh2906 merged commit ec1ecd7 into develop Mar 13, 2026
3 checks passed
@dh2906 dh2906 deleted the fix/image-convert-library branch March 13, 2026 06:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

버그 정상적으로 동작하지 않는 문제 상황 관련 이슈입니다.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant