Page 1 of 1

Wrong behavior when using -crop and -window with display

Posted: 2008-03-21T16:15:10-07:00
by naoliv
Hi!

From this bug report on Debian (http://bugs.debian.org/266304):
Even without -geometry, I get strange results. Please try:

display -crop 576x384 -window root /usr/share/doc/imagemagick/images/examples.jpg

Several images are successively displayed in the root window, then
I get a blank image. Using 576x384+0+0 (i.e. adding a location)
solves the problem here (unfortunately the documentation is missing).
I can reproduce it with ImageMagick 6.4.0-0 beta

Code: Select all

display -crop 576x384 -window root /usr/share/doc/ImageMagick-6.4.0/images/examples.jpg
It displays several images and then left my desktop background all white.

Thank you!

Re: Wrong behavior when using -crop and -window with display

Posted: 2008-03-21T18:07:04-07:00
by magick
Crop repeats if no specific x,y offset is specified. See http://www.imagemagick.org/Usage/crop/#crop for details. The solution is to specify the offset as the user suggested:
  • display -crop 576x384+0+0 -window root /usr/share/doc/ImageMagick-6.4.0/images/examples.jpg

Re: Wrong behavior when using -crop and -window with display

Posted: 2008-04-16T15:53:25-07:00
by naoliv
Hi!

Still from 266304:
In the past, -crop was resizing the image, at least when -geometry was given. This no longer works. For instance,

Code: Select all

display -crop 88x100+0+4 -resize 176x200 /usr/share/doc/imagemagick/images/frame.jpg
and

Code: Select all

display -crop 88x100+0+4 +repage -resize 176x200 /usr/share/doc/imagemagick/images/frame.jpg
both give the cropped image, without resizing, whereas

Code: Select all

convert -crop 88x100+0+4 /usr/share/doc/imagemagick/images/frame.jpg - | display -resize 176x200 -
gives the expected result.

Re: Wrong behavior when using -crop and -window with display

Posted: 2008-04-16T17:18:16-07:00
by magick
We can reproduce the problem you posted and have a patch in ImageMagick 6.4.0-8 Beta to fix it. 6.4.0-8 Beta will be available sometime tomorrow. Thanks.