[Resolved] possible bug mpr IM 6.9.4.9 Mac OSX

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
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

[Resolved] possible bug mpr IM 6.9.4.9 Mac OSX

Post by fmw42 »

I am not sure if this is a bug.

I am trying to split and image into its 4 quadrants and pad them out to the original size in a transparent background in the proper corners.

input:
Image

This works fine:

Code: Select all

convert -respect-parentheses -size 256x256 xc:none \
null: \( lena.jpg -crop 50%x50% \) -layers Composite \
lena_quads1_%d.png
as does this:

Code: Select all

convert lena.jpg -crop 50%x50% miff:- |\
convert -size 256x256 xc:none \
null: - -layers Composite \
lena_quads2_%d.png

But this fails using mpr: format. Only the last one is placed in the larger transparent area in the correct corner.

Code: Select all

convert lena.jpg -crop 50%x50% -write mpr:quads +delete \
-size 256x256 xc:none \
null: mpr:quads -layers Composite \
lena_quads3_%d.png
Seems like it only gets the offsets from the last layer of the mpr:quads. Is this the way mpr works or is this a bug?
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: possible bug mpr IM 6.9.4.9 Mac OSX

Post by magick »

The +delete option only removes one image from the sequence. You likely want this command:

Code: Select all

convert lena.jpg -crop 50%x50% -write mpr:quads -delete 0--1 \
-size 256x256 xc:none \
null: mpr:quads -layers Composite \
lena_quads3_%d.png
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: possible bug mpr IM 6.9.4.9 Mac OSX

Post by fmw42 »

Thanks you. You are correct. My oversight.
Post Reply