Phase 10 review fixes: source guards, shared quality trait, dompdf Blade corrections#142
Merged
Merged
Conversation
…de corrections Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Important Review skippedAuto reviews are limited based on label configuration. 🏷️ Required labels (at least one) (1)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 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 |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
All 8 review findings were valid. Changes kept minimal.
Fixes applied
Source file existence guards (inline comment)
RendersSingleImagePdf: checkStorage::disk('local')->exists($storedPath)beforeget(), throwRuntimeExceptionwith path context if missingPngToJpg,JpgToPng,PngToWebp,JpgToWebp): same guard beforedecodePath()— applied consistently, not just toJpgToWebpDriverGD procedural code removed (nitpick)
RendersSingleImagePdf::resolveOrientation: replacedimagecreatefromstring()/imagesx()/imagesy()withImageManager::decodeBinary()+->width()/->height(); decode failure now throws instead of silently returning'portrait'Shared quality trait (nitpick)
Concerns/ResolvesImageQualitytrait;PngToJpgDriver,PngToWebpDriver,JpgToWebpDrivernowuse ResolvesImageQuality— localresolveQuality()methods removedUnused parameter removed (nitpick)
ConversionContextFactory::forSourcePath():$outputExtensionparameter dropped; all 6 driver test files updated to remove the argumentdompdf Blade template (code violations)
display:flex/object-fit(unsupported by dompdf) with table-based centering forcontainmodefillbranch tocover(aligns with Phase 4fit_mode: contain/cover/original)resolvePageSize()added inRendersSingleImagePdf: maps'auto'→'a4'before passing tosetPaper()Test plan
composer testpasses — 268/268 testscomposer lintpasses🤖 Generated with Claude Code
Summary by cubic
Improves image conversion reliability and PDF rendering by adding source file guards, fixing orientation detection, and updating the dompdf Blade to supported CSS. Also deduplicates quality handling and removes an unused factory parameter.
Bug Fixes
RendersSingleImagePdfand all image drivers; throwRuntimeExceptionwith path context.intervention/imageto decode binaries for orientation; fail fast on decode errors (no silent portrait fallback).fill→cover, and mappage_size: autotoa4beforesetPaper().Refactors
ResolvesImageQualitytrait; remove duplicateresolveQuality()from JPG/PNG/WebP drivers.$outputExtensionfromConversionContextFactory::forSourcePath(); update tests accordingly.Written for commit 74b5856. Summary will update on new commits.