Non coherent behaviour...Command line

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
darrepac

Non coherent behaviour...Command line

Post by darrepac »

Hi

I am using IM and particularly montage in order to create a 1 big mosaic file from x number of tiles image:

Code: Select all

montage 032x/*/*.png -mode Concatenate -tile 64x64 -transpose -compress lzw 032x.tif
All was working fine except when I arrive to 4096 files. My shell (cygwin under Vista) told me that the argument list was too long.
After googling I saw that I just need to quote to permit IM to the expansion itself (and not the shell):

Code: Select all

montage '032x/*/*.png' -mode Concatenate -tile 64x64 -transpose -compress lzw 032x.tif
Problem, it never worked! I got always "unable to open image '032x/*/*.png' " etc

So I try to find a workaround and I thought I found it. I will put the list of file in a file and then read the input from this file. To be able to test well I tried with a limited number of tiles:

Code: Select all

ls 002x/*/*.png > mylist.txt
montage @mylist.txt -mode Concatenate -tile 4x4 -transpose -compress lzw 002x.tif
Problem, and this is where it is not coherent, the resulting filename is not the same than when I read directly from the argument list.
The resulting images has what should be the first column placed at the end. So the first column become the last column and the 2nd column become the first.
I have
5 9 13 1
6 10 14 2
7 11 15 3
8 12 16 4

instead of
1 5 9 13
2 6 10 14
3 7 11 15
4 8 12 16

Obvioulsy I checked that the list in mylist.txt was in the right order:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16

I also tried to do that:

Code: Select all

ls 032x/*/*.png | montage @- -mode Concatenate -tile 64x64 -transpose -compress lzw 032x.tif
With the same result than above (column miss-placed)

Conclusion:
- I did not find a way to get around "Argument list too long" problem. The 2 solutions I found were either not working (quote) or making problem (@file => column mixed)
- I found a non coherent behaviour: 2 different result depending how I put the arguments (inline or through a @filename)

Any help appreciated :)
darrepac

Re: Non coherent behaviour...Command line

Post by darrepac »

I finally found that it was not a problem of mixed column but just that the first file of the list inside mylist.txt was not taken into account.
Why? I don't know but I just duplicate the first file at the beginning of the file and it just works.....well in fact Windows cannot allocate enough memory to render the file but I will find a way ;)
Post Reply