chop not working with gravity switch

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
beth1985

chop not working with gravity switch

Post by beth1985 »

Hi,

I am trying to crop one pixel off the right side of an image thats 2048x1024. When I enter the command, it gives me this error:

[r@ariel Desktop]% convert new.png -gravity east -chop 1x0 new1.jpg
convert: geometry does not contain image `new.png' @ transform.c/ChopImage/132.

Is something wrong with my image or am I using the command wrong?

Thanks
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: chop not working with gravity switch

Post by fmw42 »

works fine for me on IM 6.5.9.1 Q16 Mac OSX Tiger

using IM logo: image

identify logo:
logo:=>LOGO LOGO 640x480 640x480+0+0 8-bit PseudoClass 256c 38.3KB 0.000u 0:00.000


convert logo: -gravity east -chop 1x0 logo_chop1e.gif
identify logo_chop1e.gif
logo_chop1e.gif GIF 639x480 639x480+0+0 8-bit PseudoClass 256c 38.3KB 0.010u 0:00.000

What version of IM are you using. If old, perhaps upgrade. Also try it on any other image, such as the logo: (IM special) image.

Or post a link to your image so others can check it.
beth1985

Re: chop not working with gravity switch

Post by beth1985 »

I am using Version: ImageMagick 6.5.1-0 2009-08-27 on Ubuntu 9.1 Karmic Koala

Hmm it does work with another image. I wonder what is wrong with my current image. Here is a copy of it:

http://dl.dropbox.com/u/1791470/file1.png

I'm trying to crop the one pixel of white on the right side. As a work around, I rolled the image one pixel and then chopped off the left side.

Thanks for th help.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: chop not working with gravity switch

Post by fmw42 »

beth1985 wrote:I am using Version: ImageMagick 6.5.1-0 2009-08-27 on Ubuntu 9.1 Karmic Koala

Hmm it does work with another image. I wonder what is wrong with my current image. Here is a copy of it:

http://dl.dropbox.com/u/1791470/file1.png

I'm trying to crop the one pixel of white on the right side. As a work around, I rolled the image one pixel and then chopped off the left side.

Thanks for th help.
Your image has a virtual canvas that needs to be removed by +repage.

Identify -verbose file1.png
Geometry: 2048x1024+0+0
Page geometry: 2559x2560+255+767


This works:

convert file1.png +repage -gravity east -chop 1x0 file1_chop1e.png


see http://www.imagemagick.org/Usage/crop/#crop_repage
beth1985

Re: chop not working with gravity switch

Post by beth1985 »

That makes sense - thanks for all the help!
Post Reply