I used irfanview to create a panorama of 12 images (4 columns X 3 rows). So this is only for people using irfanview.
But I have included a link to it's portable version below for those who want to try it. its 1.15mb.
So here's the script:
Code: Select all
//folderJPG.xys
//This script creates folder.jpg for the current folder by picking 12 random images and making a panorama of 4 columns X 3 rows (using irfanview image viewer)
//If the current folder has subfolders then folder.jpg will be a result of iamges from those folders too
//If the current folder (including subfolders) has less than 12 images then 4 random mages are picked and making 2 columns X 2 rows
//You can opt to sample images regularly instead of randomly
// DEPENDENCIES: IrfanView (this script will work as is, if XYplorer and IrfanView are in the same folder and the script is placed inside XYplorer's script folder).
filter "folder.jpg";
$folderexists= getinfo ("countitems");
IF ($folderexists > 0) {
selfilter "folder.jpg";
focus;
//duplicate folder.jpg (basically backing up old folder.jpg)
#165;
filter;
}
ELSE {
filter;
}
//set views to details
#302;
//Search current folder for jpg, tif, jpeg, png, gif but exclude folder.jpg and its backups.
//If you want folder.jpg for only the current folder and not its subfolders then remove r after / from the end of next line
goto "?: !folder*.jpg & \*.jpg | \*.tif | \*.jpeg | \*.png | \*.gif /r";
//count items in list
$items=getinfo("countitems");
//sortby random order
#331;
//if you want regularly sampled images instead of random images then remove the // from next line
// sortby name;
IF ($items>=12) {
//Select first list item
sel 1;
$file1=<curitem>;
//select 9th list item if 100 items
sel ($items/11);
$file2=<curitem>;
//select 18th list item if 100 items
sel (($items/11)*2);
$file3=<curitem>;
//select 27th list item if 100 items
sel (($items/11)*3);
$file4=<curitem>;
//select 36th list item if 100 items
sel (($items/11)*4);
$file5=<curitem>;
//select 45th list item if 100 items
sel (($items/11)*5);
$file6=<curitem>;
//select 54th list item if 100 items
sel (($items/11)*6);
$file7=<curitem>;
//select 63rd list item if 100 items
sel (($items/11)*7);
$file8=<curitem>;
//select 72nd list item if 100 items
sel (($items/11)*8);
$file9=<curitem>;
//select 81st list item if 100 items
sel (($items/11)*9);
$file10=<curitem>;
//select 90th list item if 100 items
sel (($items/11)*10);
$file11=<curitem>;
//Select last list item
sel $items;
$file12=<curitem>;
$pan1="<curpath>\pan1.jpg";
$pan2="<curpath>\pan2.jpg";
$pan3="<curpath>\pan3.jpg";
$pan4="<curpath>\pan4.jpg";
$pan5="<curpath>\pan5.jpg";
$pan6="<curpath>\pan6.jpg";
$pan7="<curpath>\pan7.jpg";
$pan8="<curpath>\pan8.jpg";
$pan9="<curpath>\pan9.jpg";
$pan10="<curpath>\pan10.jpg";
$pan11="<curpath>\pan11.jpg";
$pan12="<curpath>\pan12.jpg";
run """..\IrfanView\i_view32.exe"" $file1 /resize=(300 ,300) /aspectratio /resample /convert $pan1 /killmesoftly",,1;
run """..\IrfanView\i_view32.exe"" $file2 /resize=(300 ,300) /aspectratio /resample /convert $pan2 /killmesoftly",,1;
run """..\IrfanView\i_view32.exe"" $file3 /resize=(300 ,300) /aspectratio /resample /convert $pan3 /killmesoftly",,1;
run """..\IrfanView\i_view32.exe"" $file4 /resize=(300 ,300) /aspectratio /resample /convert $pan4 /killmesoftly",,1;
run """..\IrfanView\i_view32.exe"" $file5 /resize=(300 ,300) /aspectratio /resample /convert $pan5 /killmesoftly",,1;
run """..\IrfanView\i_view32.exe"" $file6 /resize=(300 ,300) /aspectratio /resample /convert $pan6 /killmesoftly",,1;
run """..\IrfanView\i_view32.exe"" $file7 /resize=(300 ,300) /aspectratio /resample /convert $pan7 /killmesoftly",,1;
run """..\IrfanView\i_view32.exe"" $file8 /resize=(300 ,300) /aspectratio /resample /convert $pan8 /killmesoftly",,1;
run """..\IrfanView\i_view32.exe"" $file9 /resize=(300 ,300) /aspectratio /resample /convert $pan9 /killmesoftly",,1;
run """..\IrfanView\i_view32.exe"" $file10 /resize=(300 ,300) /aspectratio /resample /convert $pan10 /killmesoftly",,1;
run """..\IrfanView\i_view32.exe"" $file11 /resize=(300 ,300) /aspectratio /resample /convert $pan11 /killmesoftly",,1;
run """..\IrfanView\i_view32.exe"" $file12 /resize=(300 ,300) /aspectratio /resample /convert $pan12 /killmesoftly",,1;
$panorama1="<curpath>\panorama1.jpg";
$panorama2="<curpath>\panorama2.jpg";
$panorama3="<curpath>\panorama3.jpg";
run """..\IrfanView\i_view32.exe"" /panorama=(1,$pan1,$pan2,$pan3,$pan4) /convert $panorama1 /silent",,1;
run """..\IrfanView\i_view32.exe"" /panorama=(1,$pan5,$pan6,$pan7,$pan8) /convert $panorama2 /silent",,1;
run """..\IrfanView\i_view32.exe"" /panorama=(1,$pan9,$pan10,$pan11,$pan12) /convert $panorama3 /silent",,1;
run """..\IrfanView\i_view32.exe"" /panorama=(2,$panorama1,$panorama2,$panorama3) /convert ""<curpath>\folder.jpg"" /silent",,1;
delete 0,0, $pan1|$pan2|$pan3|$pan4|$pan5|$pan6|$pan7|$pan8|$pan9|$pan10|$pan11|$pan12|$panorama1|$panorama2|$panorama3;
//go to previous location
#520;
goto <curpath>;
}
ELSEIF ($items>6 && $items <12){
//Select first list item
sel 1;
$file1=<curitem>;
//select 33rd list item if 100 items
sel ($items/3);
$file2=<curitem>;
//select 66th list item if 100 items
sel (($items/3)*2);
$file3=<curitem>;
//select last list
sel $items;
$file4=<curitem>;
$pan1="<curpath>\pan1.jpg";
$pan2="<curpath>\pan2.jpg";
$pan3="<curpath>\pan3.jpg";
$pan4="<curpath>\pan4.jpg";
run """..\IrfanView\i_view32.exe"" $file1 /resize=(600 ,600) /aspectratio /resample /convert $pan1 /killmesoftly",,1;
run """..\IrfanView\i_view32.exe"" $file2 /resize=(600 ,600) /aspectratio /resample /convert $pan2 /killmesoftly",,1;
run """..\IrfanView\i_view32.exe"" $file3 /resize=(600 ,600) /aspectratio /resample /convert $pan3 /killmesoftly",,1;
run """..\IrfanView\i_view32.exe"" $file4 /resize=(600 ,600) /aspectratio /resample /convert $pan4 /killmesoftly",,1;
$panorama1="<curpath>\panorama1.jpg";
$panorama2="<curpath>\panorama2.jpg";
run """..\IrfanView\i_view32.exe"" /panorama=(1,$pan1,$pan2) /convert $panorama1 /silent",,1;
run """..\IrfanView\i_view32.exe"" /panorama=(1,$pan3,$pan4) /convert $panorama2 /silent",,1;
run """..\IrfanView\i_view32.exe"" /panorama=(2,$panorama1,$panorama2) /convert ""<curpath>\folder.jpg"" /silent",,1;
delete 0,0, $pan1|$pan2|$pan3|$pan4|$panorama1|$panorama2;
//go to previous location
#520;
goto <curpath>;
}
ELSE {
goto <curpath>;
}
Direct link to IrfanView zip file.
Download
The above script will work without modifications if you extract the zip contents into a folder called "IrfanView" which is in the same folder as XYplorer, for eg: C:\Program files.
Have fun and Please report problems too.
XYplorer Beta Club