junaidbhura / fly-dynamic-image-resizer

Fly Dynamic Image Resizer plugin for WordPress
https://wordpress.org/plugins/fly-dynamic-image-resizer/
MIT License
161 stars 26 forks source link

Image size which preserves aspect ratio #32

Closed kennithnichol closed 4 years ago

kennithnichol commented 4 years ago

The script for adding an image size does not support passing a zero (0) for width or height. WordPress supports this behaviour to allow images to be resized and retain their aspect ratio.

The logic of if ( ! $height || ! $width ) when $width === 0 || $height === 0 is incorrect.

I propose permitting zero with an additional check for zero on those statements.

kennithnichol commented 4 years ago

I have also restore the msyql service to the Travis CI configuration, since the builds were failing without it.

junaidbhura commented 4 years ago

Thanks a bunch! I'm gonna take a deeper look at this and get back to you!

junaidbhura commented 4 years ago

Hey @kennithnichol I've added a comment on your pull request: https://github.com/junaidbhura/fly-dynamic-image-resizer/pull/31#issuecomment-650475314

Thanks so much for your contribution, but I think it would be best to not include this functionality in this plugin. Sorry about that!