Conversation
Summary of ChangesHello @imsus, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request focuses on updating the project's documentation to align with the new 1.1.0 release. The core change is the introduction of a more fluent and readable API for image URL generation, simplifying method calls and adding new features like cache busting and fallback URLs. The updates ensure that users have clear guidance on leveraging the latest capabilities while maintaining compatibility with existing implementations. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request does a great job of updating the documentation to use the new fluent API, making the examples more concise and readable. I've found a few inconsistencies between the documentation and the source code that should be addressed. Specifically, the documentation refers to processing() and fill() methods which appear to be named setProcessing() and fillDown() respectively in the code. There are also a couple of code examples with invalid syntax. I've left detailed comments on these points. After these fixes, the documentation will be in excellent shape.
| ```php | ||
| $url = imgproxy('https://example.com/image.jpg') | ||
| ->setProcessing('rs:fill:400:300:1/rt:fit/q:85/bl:2.0') | ||
| ->processing('rs:fill:400:300:1/rt:fit/q:85/bl:2.0') |
There was a problem hiding this comment.
The documentation is updated to use ->processing(), but this method does not seem to exist in the ImgProxy class. The existing method is setProcessing(). Please either add the processing() alias method if it was missed, or update the documentation to use setProcessing().
| ->processing('rs:fill:400:300:1/rt:fit/q:85/bl:2.0') | |
| ->setProcessing('rs:fill:400:300:1/rt:fit/q:85/bl:2.0') |
| ```php | ||
| $url = imgproxy('https://example.com/image.jpg') | ||
| ->setProcessing('rs:fill:400:300:1/rt:fit/q:85/bl:2.0') | ||
| ->processing('rs:fill:400:300:1/rt:fit/q:85/bl:2.0') |
There was a problem hiding this comment.
The example uses ->processing(), but this method does not appear to exist in the ImgProxy class. The correct method is setProcessing(). This is also inconsistent with the API reference tables in this document. Please correct the example and ensure the API tables are accurate.
| ->processing('rs:fill:400:300:1/rt:fit/q:85/bl:2.0') | |
| ->setProcessing('rs:fill:400:300:1/rt:fit/q:85/bl:2.0') |
| ->setResizeType(ResizeType::FORCE) | ||
| ->width(300) | ||
| ->height(200) | ||
| ->fill() |
| ->avif() // Output as AVIF | ||
| ->png() // Output as PNG | ||
| ->jpg() // Output as JPEG |
There was a problem hiding this comment.
This code block contains invalid PHP syntax. The lines starting with -> are not valid statements on their own, which could be confusing. Please consider rewriting this to be a valid code snippet or using a list format for clarity.
| ->avif() // Output as AVIF | |
| ->png() // Output as PNG | |
| ->jpg() // Output as JPEG | |
| // ->avif() // Output as AVIF | |
| // ->png() // Output as PNG | |
| // ->jpg() // Output as JPEG |
| ->contain() // Fit within area (ResizeType::FIT) | ||
| ->fill() // Force dimensions (ResizeType::FILL_DOWN) |
There was a problem hiding this comment.
This example has two issues:
- The lines starting with
->are not valid PHP statements. - The method
->fill()is used, but the correct method is->fillDown().
Please correct the example for clarity and accuracy.
| ->contain() // Fit within area (ResizeType::FIT) | |
| ->fill() // Force dimensions (ResizeType::FILL_DOWN) | |
| // ->contain() // Fit within area (ResizeType::FIT) | |
| // ->fillDown() // Force dimensions (ResizeType::FILL_DOWN) |
| | `jpg()` | - | Output as JPEG | | ||
| | `cover()` | - | Set resize type to fill | | ||
| | `contain()` | - | Set resize type to fit | | ||
| | `fill()` | - | Set resize type to fill-down | |
| |------------|---------------|-------------| | ||
| | `FIT` | `contain()` | Resize keeping aspect ratio to fit within dimensions (default) | | ||
| | `FILL` | `cover()` | Resize keeping aspect ratio to fill dimensions, cropping overflow | | ||
| | `FILL_DOWN` | `fill()` | Same as fill, but maintains aspect ratio for smaller images | |
There was a problem hiding this comment.
The fluent method for FILL_DOWN is fillDown(), not fill(). Please correct the method name in the table.
| | `FILL_DOWN` | `fill()` | Same as fill, but maintains aspect ratio for smaller images | | |
| | `FILL_DOWN` | `fillDown()` | Same as fill, but maintains aspect ratio for smaller images | |
No description provided.