IM7: subimage specification returns no images

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
Lars-Daniel
Posts: 37
Joined: 2015-09-20T05:55:17-07:00
Authentication code: 1151

IM7: subimage specification returns no images

Post by Lars-Daniel »

Hi there,

this has worked for years in IM6, I've changed montage to magick montage for IM7:

Code: Select all

magick montage "02_%04d.png[1-63]" -tile 9x7 -geometry 256x256+0+0 test.png
But now I'm getting tons of these:

Code: Select all

magick: subimage specification returns no images `02_0030.png' @ error/constitute.c/ReadImage/637.
magick: invalid image index `02_0031.png' @ error/list.c/CloneImages/281.
magick: subimage specification returns no images `02_0031.png' @ error/constitute.c/ReadImage/637.
magick: invalid image index `02_0032.png' @ error/list.c/CloneImages/281.
magick: subimage specification returns no images `02_0032.png' @ error/constitute.c/ReadImage/637.
magick: TooManyExceptions (exception processing is suspended) @ warning/exception.c/ThrowException/978.
magick: invalid image index `02_0033.png' @ error/list.c/CloneImages/281.
Of course, the files are existing and valid, identify doesn't show any problems.

my build is:

Code: Select all

Version: ImageMagick 7.0.8-25 Q8 x64 2019-01-28 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2018 ImageMagick Studio LLC
License: http://www.imagemagick.org/script/license.php
Visual C++: 180040629
Features: Cipher DPC Modules OpenMP
Delegates (built-in): bzlib cairo flif freetype gslib heic jng jp2 jpeg lcms lqr lzma openexr pangocairo png ps raw rsvg tiff webp xml zlib
Seems like a bug to me :-(

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

Re: IM7: subimage specification returns no images

Post by fmw42 »

Are you sure you have 64 images? If so, the indices should be [0-63] if you want all of them. Seems like it is not finding anything starting and following [32]. What is your OS?

This works for me on IM 7.0.8.25 Q16 Mac OSX Sierra

Code: Select all

magick rose: rose_00.png
magick rose: rose_01.png
magick rose: rose_02.png
magick rose: rose_03.png
magick montage "rose_%02d.png[0-3]" -tile 2x2 -geometry +2+2 result.png
Lars-Daniel
Posts: 37
Joined: 2015-09-20T05:55:17-07:00
Authentication code: 1151

Re: IM7: subimage specification returns no images

Post by Lars-Daniel »

Thanks for your reply.
fmw42 wrote: 2019-02-02T00:26:28-07:00Are you sure you have 64 images?
No, more than 64. That's why I'm not using an asterisk for globbing.
fmw42 wrote: 2019-02-02T00:26:28-07:00If so, the indices should be [0-63] if you want all of them.
No, it starts at "..._0001.png"
fmw42 wrote: 2019-02-02T00:26:28-07:00What is your OS?
Microsoft Windows 7 Professional, 64-bit (Version 6.1.7601)
fmw42 wrote: 2019-02-02T00:26:28-07:00This works for me on IM 7.0.8.25 Q16 Mac OSX Sierra
Verified, this works.

Ahhh, have a look!

Code: Select all

# delete rose_00.png
magick rose: rose_01.png
magick rose: rose_02.png
magick rose: rose_03.png
magick rose: rose_04.png
magick montage "rose_%02d.png[1-4]" -tile 2x2 -geometry +2+2 result.png
Tadaa:

Code: Select all

montage: invalid image index `rose_01.png' @ error/list.c/CloneImages/281.
montage: subimage specification returns no images `rose_01.png' @ error/constitute.c/ReadImage/637.
montage: invalid image index `rose_02.png' @ error/list.c/CloneImages/281.
montage: subimage specification returns no images `rose_02.png' @ error/constitute.c/ReadImage/637.
montage: invalid image index `rose_03.png' @ error/list.c/CloneImages/281.
montage: subimage specification returns no images `rose_03.png' @ error/constitute.c/ReadImage/637.
montage: invalid image index `rose_04.png' @ error/list.c/CloneImages/281.
montage: subimage specification returns no images `rose_04.png' @ error/constitute.c/ReadImage/637.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: IM7: subimage specification returns no images

Post by fmw42 »

Agreed. If it starts with [0, it works fine even if it does not go to the last index. But if it starts with any other index, it fails.



This works:

Code: Select all

magick rose: rose_00.png
magick rose: rose_01.png
magick rose: rose_02.png
convert rose: rose_03.png
magick montage "rose_%02d.png[0-1]" -tile 2x1 -geometry +2+2 result.png
This fails:

Code: Select all

magick rose: rose_00.png
magick rose: rose_01.png
magick rose: rose_02.png
convert rose: rose_03.png
magick montage "rose_%02d.png[1-2]" -tile 2x1 -geometry +2+2 result.png
Tested with IM 7.0.8.25 Q16 Mac OSX
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: IM7: subimage specification returns no images

Post by magick »

Thanks for the problem report. We can reproduce it and will have a patch to fix it in GIT master branch @ https://github.com/ImageMagick/ImageMagick later today. The patch will be available in the beta releases of ImageMagick @ https://www.imagemagick.org/download/beta/ by sometime tomorrow.
Post Reply