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?".
knowj
Post
by knowj » 2008-02-23T06:29:23-07:00
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
Post
by knowj » 2008-02-23T07:16:26-07:00
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
Post
by Bonzo » 2008-02-23T07:17:33-07:00
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'