To obtain views as shown in the pics, your main or parent folder that display the folder subs (e.g., D:\Wallpaper or F:\Photos must be in a square thumbnail size like 240x 240 or 300x300). In my case, I have my main or parent folder as 240x240 [thumbnail size #3] with including subfolders not checked in FVS and my sub folders under it have a different size like 240x135 [thumbnail size #2]. So your saved FVSs would reflect D:\Wallpaper\ with 240x240 and another for D:\Wallpaper\* for sub folders of the 240x135 size. Of course you could also have both the main and subs all the same like 240x240 with a single FVS of D:\Wallpaper\ with including subfolders checked in FVS.
This script will create a folder thumbnails of the following types:
1) Zoom-to-Fill view using a single image - see PIC 1
Pre-select an image in current folder
Random image in current folder
Random image in current and sub folders
2) Montage of 4 random images Image Magick - see PIC 2
Zoom-to-Fill view in current folder
Polaroid view in current folder
Zoom-to-Fill view current folder and subs
3) Zoom-to-Fill Montage of 4 images using IrfanView - see PIC 3
Random images in current folder
Random images in current folder and subs
Pre-select 4 image in current folder
If you try it and have any issues, please let me know so I can correct them. Thanks.
*****************************************************************************************
*** Old version ***
Here's another script for creating a folder montage. I've called it FolderMontage. Jdev21 created a nice version here http://www.xyplorer.com/xyfc/viewtopic. ... 62#p114057 and totmad1 also created one here http://www.xyplorer.com/xyfc/viewtopic. ... 36#p114036 At least 5 years ago serendipity created the "original" one here using Irfanview here http://www.xyplorer.com/xyfc/viewtopic. ... thumbnails. Thank you to all three of you and I hope you don't mind me posting this version. I was going to post in on serendipity's old script thread but since the tread was so old and the scripts quite a bit different, I decided to start a new thread.
The script uses ImageMagick to create the montage. So to use it you will need IM installed (there is a portable version) see comment in script. This script will develop the montage (see pics) as follows:
1) It use IM's montage.exe polariod affect for the montage...obviously with little work you can change this.
2) The number of pics in the montage will be based on the number of pics in the folder. If >= 16, it will create a montage of 16 pictures, if between 9 and 15 it will have 9 pics in the montage and with < 9 it will use 4 pictures.
3) The pictures will be randomized
4) The folder name is obtained and will be included in the title of the FolderMontage.
5) As with some of the other versions it will hide the folder.jpg file. There's a menu option to unhide it.
6) It does not create a bat file to run montage.exe, but it does create a filelist.txt to feed to montage.exe. I found that using the text file as jdev21 did, avoids some issues with spaces in file names among other issues.
7) It uses a non-modal timed message to tell you what happening and flashes the reduced size verison of the montage when complete - for each folder. It's fluff but the status message wouldn't stay on the screen long enough to be of value and I didn't want the user to have to hit enter to acknowledge the message. It usesPowerShell. If you experience any issues with this, you can simply comment out the code lines, Sub "_TIMED_MESSAGE";
#8) I used a 4x4 tile only because I'm using SQUARE 240x240 thumbnails thumbs to display in a large square-full extent/aspect ratio of the thumb. If using a "240x180" thumb size, for $tile I'd use for a "5x4"/"4x3"/"3x2" and adjust $count to 20/12/6. Thanks to TheQwerty for the randomize method I used on the image pictures and to highend for the regexreplace code I used in lieu of using a foreach loop.
Code: Select all
"_Initialize";
global $parentDir, $montage_exe;
$montage_exe = "D:\Graphics\ImageMagick\montage.exe"; // montage.exe is part of the ImageMagick package (free) which can be obtained at http://www.imagemagick.org/script/binary-releases.php#windows
$parentDir = "<curpath>"; // Look for Windows binary packages on left side. You can download the no install package where no registry entries are made
if(substr("$parentDir", -1) == ":") {$parentDir = "$parentDir" . "\";}
" Generate Folder Montage (Current Folder) |:viewthumbs";
global $parentDir, $montage_exe;
if(exists("$parentDir\folder.jpg")) {
attrstamp("h", 4, "$parentDir\folder.jpg");
delete 0, 0, "$parentDir\folder.jpg";}
$image_list = formatlist(folderreport("files", "r", "<curpath>", , , "<crlf>"), "f", "<crlf>", "*.jpeg<crlf>*.jpg<crlf>*.bmp<crlf>*.png");
$image_list = regexreplace($image_list, "^(.*\\)(.*?$)", "'$2'"); // Thanks highend
$i = gettoken("$image_list", "count", "<crlf>");
if ($i >= "16") {
$count = 16; $geometry = 450x450; $tile = "4X4"} // I used a 4x4 tile only because I'm using a SQUARE 240x240 thumbnails thumbs to display in a lg square-full extent/aspect ratio of the thumb
elseif (($i >= "9") AND ($i < "16")) { // If using a "240x180" thumb size, for $tile I'd use for a "5x4"/"4x3"/"3x2" and adjust $count to 20/12/6..
$count = 9; $geometry = 550x550; $tile = "3X3"}
elseif (($i >= "4") AND ($i < "9")) {
$count = 4; $geometry = 720x720; $tile = "2x2"}
elseif ($i < "9") {end 1, "This Folder [$parentDir] does not contain enough image files to make a proper folder montage.";}
$random_images = GetToken(formatlist($image_list, 'x', "<crlf>"), $count, "<crlf>",, 1); //randomize the no of images "$count" in $image_list Thanks TheQwerty
writefile("filelist.txt", $random_images);
$folder_name = quote(getpathcomponent($parentDir, "component", -1));
Sub "_TIMED_MESSAGE"; // if you have an issue or do not want the message comment out this line. The non-modal timed message does not delay the script execution.
run "cmd /c $montage_exe @filelist.txt -geometry $geometry-1-1 -auto-orient +polaroid -background grey70 -tile $tile -font Tahoma -pointsize 26 -title $folder_name folder.jpg", , 2,0;
delete 0, 0, "$parentDir\filelist.txt";
sub "_ViewPic";
attrstamp("h", 1, "$parentDir\folder.jpg"); //if you'd rather not hide the folder montage comment out this line
"-"
" Generate Folder Montage (Current Folder and ALL Subs) |:refresh";
global $parentDir, $montage_exe, $ea_path;
if(strlen($parentDir) < 4) {$root_warning = 1;}
if($root_warning == "1") {end confirm("You are in the root directory. Are you sure you want to create folder thumbnails for the entire drive?") == 0, "Good choice, bye!";}
$paths = "$parentDir" . "<crlf>" . (folderreport("dirs", "r", $parentDir, "r", , "<crlf>"));
foreach ($ea_path, $paths, "<crlf>") {
if($ea_path == "") {continue;}
goto "$ea_path"; // experienced issues using a path with filelist.txt within the montage cmd line, so moving into each folder
if(exists("$ea_path\folder.jpg")) {
attrstamp("h", 4, "$ea_path\folder.jpg");
delete 0, 0, "$ea_path\folder.jpg"; }
$image_list = formatlist(folderreport("files", "r", "$ea_path", , , "<crlf>"), "f", "<crlf>", "*.jpeg<crlf>*.jpg<crlf>*.bmp<crlf>*.png");
$image_list = regexreplace($image_list, "^(.*\\)(.*?$)", "'$2'"); // Thanks highend
$i = gettoken("$image_list", "count", "<crlf>");
if ($i >= "16") {
$count = 16; $geometry = 450x450; $tile = "4X4"}
elseif (($i >= "9") AND ($i < "16")) {
$count = 9; $geometry = 550x550; $tile = "3X3"}
elseif (($i >= "4") AND ($i < "9")) {
$count = 4; $geometry = 750x750; $tile = "2x2"}
elseif ($i < "9") {end true, "This Folder [$ea_path] does not contain enough image files to make a proper folder montage.";}
$random_images = GetToken(formatlist($image_list, 'x', "<crlf>"), $count, "<crlf>",, 1);
writefile("$ea_path\filelist.txt", $random_images);
$folder_name = quote(getpathcomponent($parentDir, "component", -1));
Sub "_TIMED_MESSAGE"; // if you have an issue or do not want the message comment out this line. The non-modal timed message does not delay the script execution. run "cmd /c $montage_exe @filelist.txt -geometry $geometry+1+1 -auto-orient +polaroid -background grey80 -tile $tile -font Tahoma -pointsize 26 -title $folder_name folder.jpg", , 2,0;
delete 0, 0, "$ea_path\filelist.txt";
sub "_ViewPic";
attrstamp("h", 1, "$ea_path\folder.jpg"); //if you'd rather not hide the folder montage comment out this line
}
goto $parentDir;
"-"
" Remove Hidden Attribute from folder.jpg (Current Folder) |:nuke";
attrstamp("h", 4, "<curpath>\folder.jpg");
"_TIMED_MESSAGE";
global $parentDir, $ea_path;
if (substr(gettoken(caller("caption"), 1, ")", "t"), -4) == "Subs") {$montage_folder = $ea_path; }
else {$montage_folder = $parentDir; }
$t_msg = "Creating folder montage for [$montage_folder]...Please be patient...it could take a minute or three literally and substantial CPU power. The montage will flash on the screen when complete (for each folder).";
$waitSec = 10;
$PS = <<<HEREDOC
$WshShell = New-Object -Com Wscript.Shell
$WshShell.Popup("$t_msg", $waitSec, "Folder Montage", 4096)
HEREDOC;
writefile("<xyscripts>\tempPS1.ps1", $PS);
run ("%winsysdir%\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy ByPass -File ""<xyscripts>\tempPS1.ps1"""), ,0,0;
"_ViewPic";
global $parentDir, $ea_path;
if (gettokenindex("Subs)", caller("caption"), " ", "c") == "1") {$montage_folder = $ea_path; }
else {$montage_folder = $parentDir; }
makecoffee "$montage_folder\folder.jpg",1,1, 600, 600;
wait 2000; makecoffee "";
"_Terminate";
delete 0, 0, "<xyscripts>\tempPS1.ps1";
Ken