-
Notifications
You must be signed in to change notification settings - Fork 43
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
Allow 'width' or 'height' blank (or '0') values #6
Comments
I second that. It would be most helpful as I have just found out that the script currently does not do that. Unfortunately that means it's back to TimThumb for me for now. |
Well, I haven't tested this but I believe you can already do that.... so basically something like this should do the trick: <?php matthewruddy_image_resize( $url, 9999, 300, false ); ?> |
@aristath I tried the above but the script is actually resizing the image to 9999 x whatever. Can anyone else confirm that the above works? |
Here's a fork with proportional cropping enabled (when width or height are set to null or false): https://github.com/proframework/Wordpress-Timthumb-alternative/blob/master/resize.php |
This is an amazing script. Thank you. I also would really like to see this ability. @proframework your fork didn't work for me. I've dived in to trying to tweak it myself with no luck so far. Anyone else get it working? |
@coryshaw, the same here. I just copy the code and test (changing, for eg, the height number to false, and a black image appears). @proframework : I'm doing something wrong? what's the correctly way to use your updated script? |
Hmm, my fork above is working well for me. All I have to do is set the width or height to "false", and proportional sizing will kick in. So it would be something like this.. https://gist.github.com/proframework/6382826 First we check if width or height is set to false (using a shortcode). Then we check if the width or height are empty (or false), if so, we turn off cropping. Then if you do this: [image width="false" height="300"] It will resize the image proportionally. Hope this helps.. |
Hello @proframework ! Thanks for your attention! So, I can't understand what I'm doing wrong. Look my steps:
I'm running it in a local server (OSX + MAMP). |
Hi there, Maybe try this..
|
@proframework ! |
Glad I could help :) |
To allow resize based on one dimension (like WordPress currently works)
The text was updated successfully, but these errors were encountered: