Page 1 of 1

Resizing and cropping images

Posted: 2007-09-26T09:44:30-07:00
by GeXus
Hello,
I am using the following to crop and resize images

Code: Select all

convert image_big.jpg -thumbnail x200 -gravity center -crop 120x160+0+0 +repage -format jpg -quality 91 image_120x160.jpg
This works about 90% of the time, then other times it does not seem to force the size of 120x160... Is there something extra I need to add in for it to force that size?

Thanks!

Re: Resizing and cropping images

Posted: 2007-09-26T10:21:00-07:00
by Bonzo
You have some bits in your code you do not need; try this:

Code: Select all

convert image_big.jpg -thumbnail x200 -crop 120x160+0+0 +repage -quality 91 image_120x160.jpg
You are thumbnailing to 200 high and the width will stay the same ratio. If you are for instance working on a portrate image the width will always be wrong. If you are using a landscape it will be OK.