Page 1 of 1

problem with images

Posted: 2007-02-25T21:02:59-07:00
by farish
Hi, I'm newer in IM , but i have some problem
I use ImageMagick 6.3.1
OS: MICROSOFT WINDOWS XP Prof

WEb server: Apache/1.3.9
PHP: php v5.0.5

Problem: When I run this command
convert someDirectory\image.jpg -crop x246 -resize 182x246! otherDirectory\image.jpg

from php exec() it split image to 2 or more images.
I can not find problem why it split ???
result image must be 1.

Re: problem with images

Posted: 2007-02-25T21:21:59-07:00
by magick
Try -crop x246+0+0 +repage

Re: problem with images

Posted: 2007-02-26T01:24:44-07:00
by farish
magick wrote: Try -crop x246+0+0 +repage

Thanks, but I need that images size will equal 182x246

Re: problem with images

Posted: 2007-02-26T11:26:41-07:00
by Bonzo
You are not using the crop function correctly farish.

As I understand it
-crop x246 is cropping the image into 246 wide parts so if the image is 2460 wide you will get 10 images.

You want
-crop x246+0+0 which will crop the image once into a piece 246 wide with in this case the top left of the crop located at the top left of the original picture.

Check out Anthony's examples http://www.imagemagick.org/Usage/

Re: problem with images

Posted: 2007-02-27T03:06:06-07:00
by pkashrai
Try the code below!! Hope it works for you!!!!

Code: Select all

convert -crop 182x246+0+0 "thisfolder/img.jpg"  "otherfolder/reimg.jpg"
You will get the image of your size cropped from the position (0,0) ie; (top-left part of your image).

Re: problem with images

Posted: 2007-02-28T16:37:21-07:00
by farish
Much thanks for help.

Re: problem with images

Posted: 2007-02-28T21:15:00-07:00
by anthony
You can also use -path to sepcify a different output directory for images being saved to disk. This is especially useful with "montage".