Page 1 of 1

append problem with more than 9 files

Posted: 2010-10-16T06:52:31-07:00
by indiego
Hi,

I use

convert box[1-12].png +append allboxes.png

to append several boxes to a single picture. Sadly the result contains only the boxes 10 to 12. Am I missing something here?
(ImageMagick-6.6.5-Q16-windows on Vista Pro 64bit)

Peter

Re: append problem with more than 9 files

Posted: 2010-10-16T09:13:42-07:00
by el_supremo
Try this:

Code: Select all

convert box%2d.png[1-12] +append allboxes.png
Pete

Re: append problem with more than 9 files

Posted: 2010-10-16T09:32:33-07:00
by indiego
el_supremo wrote:Try this:

Code: Select all

convert box%2d.png[1-12] +append allboxes.png
Pete
$ convert box%2d.png[0-12] +append text.png
convert.exe: unable to open image `box%2d.png': No such file or directory @ error/blob.c/OpenBlob/2572.
convert.exe: unable to open file `box%2d.png' @ error/png.c/ReadPNGImage/3138.
convert.exe: missing an image filename `text.png' @ error/convert.c/ConvertImageCommand/2946.

Thanks for the quick reply, but it seems that my shell is not clever enough for that.

Re: append problem with more than 9 files

Posted: 2010-10-16T09:50:28-07:00
by fmw42
What are your actual file names? PNG does not support multiple frames. So you need to do something like what el_supremo suggested with the right frame indicators on the wildcard numbering for your images, if they are named appropriately.

Re: append problem with more than 9 files

Posted: 2010-10-16T11:15:55-07:00
by indiego
fmw42 wrote:What are your actual file names? PNG does not support multiple frames. So you need to do something like what el_supremo suggested with the right frame indicators on the wildcard numbering for your images, if they are named appropriately.
I tried to use "box[10-21].png" instead, but got the same bad result. The only thing that worked is using

box[1,2,3,4,5,6,7,8,9,10,11,12].png

or even shorter (but harder to program)

box[1-9,10-12].png

Looks like a wildcard problem to me. Anyhow, I can live with this solution. Not that nice but ways better than writing out all picture names.
If someone has a better idea, please let me know.

Thanks! :)

Re: append problem with more than 9 files

Posted: 2010-10-16T11:44:24-07:00
by fmw42
PNG does not allow multi-frame images. So something is wrong. Again what are the actual file names if PNG, such as box1.png box2.png ... box12.png. If that is the case, then you should be able to do

convert box%d.png[1-10] +append result

this works for me (IM 6.6.5.0 Q16 Mac OSX Tiger)


convert rose: rose1.png
convert rose: rose2.png
convert rose: rose3.png
convert rose: rose4.png
convert rose: rose5.png
convert rose%d.png[1-3] +append rose_tmp.png

This I believe will append rose2, rose3, rose4 as the sequence numbers in parenthesis start with 0 for the first image in the command line.

Re: append problem with more than 9 files

Posted: 2010-10-16T11:50:40-07:00
by el_supremo
My bad. I should have used %d - not %2d. I just tried this sort of thing in a DOS window on XP and it works.

Code: Select all

convert box%2d.png[1-12] +append allboxes.png
Pete

Re: append problem with more than 9 files

Posted: 2010-10-16T12:09:27-07:00
by indiego
We have a bingo :D

convert box%d.png[1-12] +append allboxes.png

works here! I have to check the used index, but it should be no problem, as I create (and delete) all temporay box pictures at runtime.

Many thanks to both of you!!