Page 1 of 1

Splitting montage thumbnail output across multiple files (if X images found)

Posted: 2017-05-14T11:11:50-07:00
by l2g
This command has done me so much justice; i love it. I was able to thumbnail all of the photos I took with my digital camera over the years with a simple Linux find command merged with this:

Code: Select all

montage -label '%t\n%[width]x%[height]' \
          -size 512x512 '*[240x180]' -auto-orient \
          -geometry +5+5 -tile 5x  -frame 5  -shadow thumb.png &>/dev/null
However... My problem is: some vacations with my camera had me get carried away; I'd take well over 1600+ photos (which i realize isn't that much to an avid photographer), but it appears to be a bit much for montage. All of these images are sitting in one of the directories the command above would process. Although it can appear to generate these insanely gigantic thumbnail files... they're a bit useless and over-sized (and very difficult to reference as a result). These thumbnail files exceed 300MB+ in size even in some cases.

Can montage be tailored to spit out multiple thumbnail/index files if more then say... 200 images were found in the directory it's creating a montage of? Is this possible?

Something like this for example in a case where 500 images were found:
  • thumb01.png (x200 images)
  • thumb02.png (x200 images)
  • thumb03.png (x100 images)

Re: Splitting montage thumbnail output across multiple files (if X images found)

Posted: 2017-05-14T11:35:40-07:00
by fmw42
I think you will have to write a script. You could create lists of groups of 200 and then loop over montage once for each list of files.

Re: Splitting montage thumbnail output across multiple files (if X images found)

Posted: 2017-05-14T12:01:13-07:00
by l2g
Thank you for your fast response; I'll do just as you say and set up a small script to do what i want through small batches.

That said though, i just have one last question: this argument here (in the montage call): *[240x180]

Will it become:
file1 file2 ... file200 [240x180]

Or will it become:
file1[240x180] file2[240x180] ... file200[240x180]

Thanks for all your help!

Re: Splitting montage thumbnail output across multiple files (if X images found)

Posted: 2017-05-14T12:15:13-07:00
by fmw42
It should be the latter. But I would suggest you test on just a few images to be sure it does what you want. Are you trying to resize or crop? That command should resize. That should work with *, but I am not sure it will work with a file list. I suspect it will not unless you have your file list contain image1[...]. image2[...].

However, you can use -resize in the montage command

Code: Select all

montage image1 image2 image3 ... -resize 320x240 .... result.png

Re: Splitting montage thumbnail output across multiple files (if X images found)

Posted: 2017-05-14T13:09:06-07:00
by l2g
The -resize switch greatly helped ease the scripting. I got it working the way i want it now. You can close/lock this thread if you want.

Thank you so much for all of your help!