Page 1 of 1

Image Resizing to the wrong dimensions

Posted: 2008-02-23T06:29:23-07:00
by knowj
I am doing a simple image resize using image magic and on both the thumbnail and detail image they are resizing to the wrong dimensions:

Code: Select all

ImageMagik Code:
convert -density 72 -resize 132x79 -quality 85 '/home/httpd/vhosts/domain.com/subdomains/website/httpdocs/images/gallery/20080223123924.jpg' '/home/httpd/vhosts/domain.com/subdomains/website/httpdocs/images/gallery/20080223123924_thumb.jpg'

Detail image:
ImageMagik Code:
convert -density 72 -resize 800x450 -quality 85 '/home/httpd/vhosts/domain.com/subdomains/website/httpdocs/images/gallery/20080223123926.jpg' '/home/httpd/vhosts/domain.com/subdomains/website/httpdocs/images/gallery/20080223123926_detail.jpg'
The image dimensions being output are:
thumb = 105px X 79px
detail = 600px X 450px

Thanks in advance

Re: Image Resizing to the wrong dimensions

Posted: 2008-02-23T07:16:26-07:00
by knowj
Problem fixed it was down to me calculating the dimensions wrong earlier in the code.

Re: Image Resizing to the wrong dimensions

Posted: 2008-02-23T07:17:33-07:00
by Bonzo
The code is working correctly - it is keeping the aspect ratio.

See below for the resize options.

http://www.imagemagick.org/script/comma ... hp?#resize

Also you read the image in first:

Code: Select all

convert '/home/httpd/vhosts/domain.com/subdomains/website/httpdocs/images/gallery/20080223123924.jpg' -density 72 -resize 132x79 -quality 85 '/home/httpd/vhosts/domain.com/subdomains/website/httpdocs/images/gallery/20080223123924_thumb.jpg'