Image Resizing to the wrong dimensions

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
knowj

Image Resizing to the wrong dimensions

Post 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
knowj

Re: Image Resizing to the wrong dimensions

Post by knowj »

Problem fixed it was down to me calculating the dimensions wrong earlier in the code.
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: Image Resizing to the wrong dimensions

Post 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'
Post Reply