fix(cbx-reader): add GIF and BMP to supported image extensions#230
Conversation
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
📝 WalkthroughWalkthroughThe Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Suggested labels
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
✨ Simplify code
Comment |
There was a problem hiding this comment.
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
`@booklore-api/src/main/java/org/booklore/service/reader/CbxReaderService.java`:
- Line 42: The controller currently hardcodes "image/jpeg" when streaming CBX
pages; update the BookMediaController method that serves CBX pages (the handler
around lines 65-76) to derive the actual MIME type from the selected archive
entry (the CBX page entry you obtain via
CbxReaderService/SUPPORTED_IMAGE_EXTENSIONS) and call
response.setContentType(mimeType) before writing the page bytes to the output
stream; ensure the MIME string comes from the archive entry's metadata or by
mapping the entry's file extension to a proper MIME (e.g., via a small helper or
existing mapping) and use that value instead of the fixed "image/jpeg".
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 9c338a48-8902-4e68-b3f8-0da15cd5ea6d
📒 Files selected for processing (1)
booklore-api/src/main/java/org/booklore/service/reader/CbxReaderService.java
📜 Review details
🧰 Additional context used
📓 Path-based instructions (1)
booklore-api/src/**/*.java
📄 CodeRabbit inference engine (AGENTS.md)
booklore-api/src/**/*.java: Use 4-space indentation in Java files and match surrounding Java style
Prefer constructor injection via Lombok patterns already used in the codebase. Do not introduce@Autowiredfield injection
Use MapStruct for entity/DTO mapping
Files:
booklore-api/src/main/java/org/booklore/service/reader/CbxReaderService.java
balazs-szucs
left a comment
There was a problem hiding this comment.
Thank you for investigating this, and raising a PR!
…ory-tools#230) Co-authored-by: de.banker <hub9ray@gmail.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
…ory-tools#230) Co-authored-by: de.banker <hub9ray@gmail.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: de.banker <hub9ray@gmail.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: de.banker <hub9ray@gmail.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Description
GIF and BMP images inside CBX archives are not displayed in the web reader. This PR adds support for these formats.
Linked Issue: Fixes #165
Changes
.gifand.bmptoSUPPORTED_IMAGE_EXTENSIONSinCbxReaderService.javaTest Output
Verification
Deployed the build on my server and tested with the following CBZ file:
format_test.cbz— 8 pages, one per format (JPG, JPEG, PNG, WebP, AVIF, HEIC, GIF, BMP)format_test.zip
Summary by CodeRabbit