append problem with more than 9 files

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
indiego
Posts: 75
Joined: 2010-10-16T06:35:10-07:00
Authentication code: 8675308

append problem with more than 9 files

Post 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
el_supremo
Posts: 1015
Joined: 2005-03-21T21:16:57-07:00

Re: append problem with more than 9 files

Post by el_supremo »

Try this:

Code: Select all

convert box%2d.png[1-12] +append allboxes.png
Pete
Sorry, my ISP shutdown all personal webspace so my MagickWand Examples in C is offline.
See my message in this topic for a link to a zip of all the files.
indiego
Posts: 75
Joined: 2010-10-16T06:35:10-07:00
Authentication code: 8675308

Re: append problem with more than 9 files

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

Re: append problem with more than 9 files

Post 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.
indiego
Posts: 75
Joined: 2010-10-16T06:35:10-07:00
Authentication code: 8675308

Re: append problem with more than 9 files

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

Re: append problem with more than 9 files

Post 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.
el_supremo
Posts: 1015
Joined: 2005-03-21T21:16:57-07:00

Re: append problem with more than 9 files

Post 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
Sorry, my ISP shutdown all personal webspace so my MagickWand Examples in C is offline.
See my message in this topic for a link to a zip of all the files.
indiego
Posts: 75
Joined: 2010-10-16T06:35:10-07:00
Authentication code: 8675308

Re: append problem with more than 9 files

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