Conversation
…void unexpected FFmpeg failures
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 0 minutes and 34 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the 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 configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughMediaHelper now treats animated WebP as unsupported by detecting animation in the WebP header and excluding such files from the image conversion/compliance path; animated WebP files will fall through to the unsupported MIME-type error. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related issues
Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 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 |
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 `@src/main/java/com/github/stickerifier/stickerify/media/MediaHelper.java`:
- Around line 299-327: The animated WebP detection in isAnimatedWebp should
parse the WebP RIFF/VP8X structure instead of substring searching; replace the
current byte-scan logic with a short structured read: open the file
(isAnimatedWebp), read at least the first 21 bytes (more if you want safety),
verify bytes 0-3 == "RIFF" and bytes 8-11 == "WEBP", check if the chunk tag at
bytes 12-15 equals "VP8X", and if so read the flags byte at offset 20 and return
((flags & 0x02) != 0) to indicate animation; if VP8X is absent, return false
(static). Update isAnimatedWebp to log/propagate IO errors consistently and use
the above checks so isSupportedImage correctly filters animated WebP via
isAnimatedWebp.
🪄 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: 99b0c8b8-d531-4087-9353-1acb85e7e9e8
📒 Files selected for processing (2)
src/main/java/com/github/stickerifier/stickerify/media/MediaHelper.javasrc/test/java/com/github/stickerifier/stickerify/media/MediaHelperTest.java
3d9ac17 to
63c85c1
Compare
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 `@src/main/java/com/github/stickerifier/stickerify/media/MediaHelper.java`:
- Around line 321-325: In isAnimatedWebp, avoid using
FileInputStream.read(header) which can return a partial read; instead use
FileInputStream.readNBytes(...) to read the fixed-length header (size
WEBP_FLAGS_BYTE_OFFSET + 1) and verify you received the exact number of bytes
before proceeding (i.e., check the returned byte array length equals the
expected header length) so the subsequent checks against WEBP_FLAGS_BYTE_OFFSET
and WebP flags are not performed on partial data.
🪄 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: e1bf30d3-4c73-488b-99bc-a1b74d832fe6
📒 Files selected for processing (1)
src/main/java/com/github/stickerifier/stickerify/media/MediaHelper.java
Summary by CodeRabbit