Skip to content

Crop defaults to true, added behaviour to crop = false#28

Open
jbjanot wants to merge 1 commit intobfintal:masterfrom
jbjanot:master
Open

Crop defaults to true, added behaviour to crop = false#28
jbjanot wants to merge 1 commit intobfintal:masterfrom
jbjanot:master

Conversation

@jbjanot
Copy link
Contributor

@jbjanot jbjanot commented Nov 19, 2014

For now, the crop parameter was unused.
It is now set to true by default.
If you pass crop: false to the parameters, il will resize, but without cropping.

Exemple with a 1200px x 800px source image
image

bfi_thumb("URL-to-image.jpg", array(
    'width' => 100,
    'height' => 100
));

This code will result, as expected, in a 100 x 100 pixels image.
image

Yet, if you use this syntax :

bfi_thumb("URL-to-image.jpg", array(
    'width' => 100,
    'height' => 100,
   'crop' => false
));

It will result in an image that is 100 x 67 pixels, and not cropped.
image

Of course, you can still grow images.
And by the way, I used an autoformat tool... Hope you don't mind ;)

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

Successfully merging this pull request may close these issues.

1 participant