excellenteasy / grunt-image-resize

Unmaintained. If you'd like to take this over please let us know. Resizing images made easy - thanks to imagemagick.
MIT License
57 stars 46 forks source link

Add option to specify the crop gravity #12

Open idflood opened 10 years ago

idflood commented 10 years ago

By default the image is cropped in the center, but on some occasion it needs top be cropped differently. For instance a page screenshot is sometimes more usefull if we only keep the top of the page and cut the bottom.

ImageMagick has an option 'gravity' which seems to do exactly that.

normanrz commented 10 years ago

I added the option to the source code. Need to wait for npm release.

boennemann commented 10 years ago

@normanrz Before we publish, can you fix the build please? (:

And thanks for shipping this fast!

normanrz commented 10 years ago

Sorry, missed that. Fixed in https://github.com/excellenteasy/grunt-image-resize/commit/e11da896016bbe5dcb46003c01923f39ea98645b

idflood commented 10 years ago

Wow, thanks for the quick addition, it works great :+1:

boennemann commented 10 years ago

@normanrz Seem like the build is still broken: https://travis-ci.org/excellenteasy/grunt-image-resize/jobs/19970045#L361

normanrz commented 10 years ago

To make the tests work again, we need to wait for a bugfix in the underlying gm module (https://github.com/aheckmann/gm/pull/260).