-
Notifications
You must be signed in to change notification settings - Fork 166
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dynamic options for Imagine filter #22
Comments
I think image size need to be configured to avoid security risks, it is a little more work but a much better result |
Ok, it was only an example. Let's imagine another filter designed for image cropping or changing of the color... Sometimes it's not possible to create so many combinations in static configuration. The beauty of Imagine filters is lost in this bundle when you cannot set options dynamically. |
I don't think it is bad to configure your filters in advance, any dynamic configuration from url is potentially abusable by end users |
fixed unit tests, fixes avalanche123GH-22
It's not possible to provide options to Imagine filter through a route. E.g. set an image size dynamically:
for file
My proposal is to add one more parameter in AvalancheImagineBundle configuration:
Directory, file and extension parameters in the route are built-in and create the path to the file. Other parameters are sent to the filter, width and height are sent to the thumbnail filter in this case.
Twig filter could look like this:
This solution has also one security issue - allows attacker to create huge amount of cached files. It could be solved with some constant number determinig the maximum number of possible caches per one image file.
What do you think about this? If you'll like this proposal I can make a pull request.
Peter
The text was updated successfully, but these errors were encountered: