Wrong behavior when using -crop and -window with display

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
naoliv
Posts: 110
Joined: 2007-12-10T18:54:27-07:00
Location: Brazil

Wrong behavior when using -crop and -window with display

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

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

Post 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
naoliv
Posts: 110
Joined: 2007-12-10T18:54:27-07:00
Location: Brazil

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

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

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

Post 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.
Post Reply