Skip to content
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

Issue with size filter like "100x100>" #16

Open
spongeben opened this issue Feb 9, 2015 · 2 comments
Open

Issue with size filter like "100x100>" #16

spongeben opened this issue Feb 9, 2015 · 2 comments

Comments

@spongeben
Copy link

There's an issue when using this kind of params directly in Twig like {{ "image.jpg" | imresize("100x100>") }}
With the actual code it results with a sh: 1: cannot create /image.jpg error.
(no problem if the resize param is set in config file)

The problem is with the > (or <) which leads to errors in the creation of the cache directory.
I made a quickfix by updating the pathify() method in Manager.php and using it more in the same file, but I don't know if it's the best way to do it...

Maybe someone with a better knowledge of this bundle can tell me if it's the right way.
(I can make a PR if required)

@Moinax
Copy link
Member

Moinax commented Feb 9, 2015

Hi, the best way is to create a format in the configuration. See http://docs.snowcap.be/im-bundle/configuration.html

The other way is just a shortcut for simple size format.

But you can of course make a PR, so we can see your solution and decide if we can merge it.

@spongeben
Copy link
Author

Yes, it works perfectly using config file.
But sometimes (...ok, when I'm lazy) it can be useful to use it directly from twig (as it's possible, why not using it ;))
I've made a PR so you can see (#17)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants