How to batch tile images in 3x2 -montage +adjoin?

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
feelart
Posts: 16
Joined: 2013-07-09T08:08:24-07:00
Authentication code: 6789

How to batch tile images in 3x2 -montage +adjoin?

Post by feelart »

Hi,

Under Win7, I have a directory of jpeg, they are lexically sorted by some date preceeding some comment about the image content, for example:
2011-07-12 12h15 My first image.jpg
2012-08-29 09h45 éèàç.jpg

Using the lexicographic order of the files, I want to make a montage of the image by group of 6, 3 in cols by 2 in rows, with output as jpeg or pdf format.
Note expected order: row1 col 1, row 1 col 2, row 1 col3, row2 col1, etc.

I tried to use

Code: Select all

montage -mode concatenate -tile 3x2 "*.jpg" +adjoin _pages%02d.jpg
But it "only" creates _pages00.jpg (3x2) and _pages01.jpg (3x1), so only 9 images while my folder as 33 jpeg...

I though the issue might be the accent or blanks in the filename, but convertion to no accent and blanks to underscore does not solve the issue.

Note: no error is prompted on shell.

Thanks for advicing.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: How to batch tile images in 3x2 -montage +adjoin?

Post by fmw42 »

Also I do not believe that montage recognizes the convert command +adjoin.

I did a simple test and indeed montage will output more than one image. IM 6.8.6.7 Q16 Mac OSX

montage -tile 2x2 -mode concatenate rose: rose: rose: rose: rose: rose: rose: rose: rose: rose: rose: rose: rose: rose: rose: rose: 1tmp1.jpg

produced four 2x2 tiled results:
1tmp1-0.jpg
1tmp1-1.jpg
1tmp1-2.jpg
1tmp1-3.jpg


Perhaps there are issues with your files or the filenames?
feelart
Posts: 16
Joined: 2013-07-09T08:08:24-07:00
Authentication code: 6789

Re: How to batch tile images in 3x2 -montage +adjoin?

Post by feelart »

*

Code: Select all

montage -tile 3x2 -mode concatenate "*.jpg" _pages%02d.jpg
works perfectly in another directory

* Note: no error is prompted on shell.
Oups, My mistake
montage.exe: unable to open image `.....': No such file or directory @ error/blob.c/OpenBlob/2643.
I look into that
feelart
Posts: 16
Joined: 2013-07-09T08:08:24-07:00
Authentication code: 6789

Re: How to batch tile images in 3x2 -montage +adjoin?

Post by feelart »

If the file name contains non US chars, such as éçàù.... then it does not work.

Test case:
à.jpg
é.jpg
è.jpg
ê.jpg

Code: Select all

identify *.jpg > dumpImgsIndentity.txt
Output
identify.exe: unable to open image `à.JPG': No such file or directory @ error/blob.c/OpenBlob/2643.
identify.exe: unable to open image `è.JPG': No such file or directory @ error/blob.c/OpenBlob/2643.
identify.exe: unable to open image `é.JPG': No such file or directory @ error/blob.c/OpenBlob/2643.
identify.exe: unable to open image `ê.JPG': No such file or directory @ error/blob.c/OpenBlob/2643.
But

Code: Select all

for %y in (*.jpg) do (identify "%y" >> dumpImgsIndentity.txt)
Perfectly works.

Should this be filed as a bug, it seems some character encoding issue (UTF8, Unicode, endianess...) ?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: How to batch tile images in 3x2 -montage +adjoin?

Post by fmw42 »

It is probably a limitation of montage compared to convert.
feelart
Posts: 16
Joined: 2013-07-09T08:08:24-07:00
Authentication code: 6789

Re: How to batch tile images in 3x2 -montage +adjoin?

Post by feelart »

On your side, can you reproduce the issue?
Post Reply