Use font in resources for exporting qrs#1046
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughQrExporterDashboard now logs font-loading failures, attempts to load a custom OpenSans TrueType font, and falls back to a default sans-serif font when the resource is unavailable or cannot be loaded. ChangesQR Export Font Handling
Estimated code review effort: 1 (Trivial) | ~5 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@backend/src/main/kotlin/hu/bme/sch/cmsch/component/token/QrExporterDashboard.kt`:
- Around line 74-85: The `renderFont` initialization in `QrExporterDashboard`
leaks the `fontStream` resource because `getResourceAsStream` is never closed.
Update the `try` block to wrap the stream in a scoped close pattern such as `use
{}` around the `Font.createFont` call, and keep the existing `logger.warn` paths
for missing or failing font loads; ensure the stream is always closed regardless
of success or exception.
🪄 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: defaults
Review profile: CHILL
Plan: Pro
Run ID: 6291f5dd-82a8-46c4-8d71-596f63a191d4
📒 Files selected for processing (1)
backend/src/main/kotlin/hu/bme/sch/cmsch/component/token/QrExporterDashboard.kt
Summary by CodeRabbit