problem with images

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
farish

problem with images

Post 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.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: problem with images

Post by magick »

Try -crop x246+0+0 +repage
farish

Re: problem with images

Post by farish »

magick wrote: Try -crop x246+0+0 +repage

Thanks, but I need that images size will equal 182x246
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: problem with images

Post 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/
pkashrai

Re: problem with images

Post 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).
farish

Re: problem with images

Post by farish »

Much thanks for help.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: problem with images

Post 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".
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply