That .vbs script works perfectly now for both horizontal and vertical panos. It's a real time saver. I'm really grateful for your help, Mij.
Announcement
Collapse
No announcement yet.
Batch Panorama creation
Collapse
X
-
Help with VBS - Irfanview vertical panoramic individual items from directory w/ 1 img
Hi Mij,
Appreciate the helpful comments.
This is bringing back an old thread but this is extremely helpful for what I am trying to accomplish.
Similar to maxwellm who replied on:
26.06.2014, 04:07 PM #9
I too am looking for a way to add a fixed common image to all the images in the directory.
Is there any pointers you could give me to have this program go through the directory one image at a time, adding the same single common image to the bottom of each image in the directory using the panorama feature.
In short, is there any way to alter the code you wrote to reflect that.
This is what I was able to accomplish in the last 8 hours but I am by no means a VBS code writer.
I will put my attempt below in CODE and QUOTE the original vbs code below that, Thanks!
Code:dim shell, fso Dim f, folderlist, item, File(4), process, panout, Irfanview, Appcall Dim mask, test, dot, extn, count set fso = CreateObject("Scripting.FileSystemObject") set shell = createObject("WScript.shell") 'Defaults Irfanview = "C:\Program Files\irfanview\i_view64.exe" 'location of irfanview application mask = "jpg,png,gif" 'files to process inside folder panextn = ".jpg" 'file type for panoramas If wscript.arguments.count = 0 then msgbox "No folder selected" : wscript.quit else process = wscript.arguments(0) end if Appcall = chr(34) & Irfanview & chr(34) & " " panout= process & "\panoramas" if fso.FolderExists(panout) = false then fso.CreateFolder(panout) Set f = fso.GetFolder(process) Set folderlist = f.Files Count=1 For Each item in folderlist test= item.name : dot=InstrRev(test,".") if dot >1 and len(test)-dot >1 then extn = mid(test,dot+1) else extn = "none" if instr(1,mask,extn,1) >0 then File(count) = test If count=2 then count=0 : pano File(1), File(horizontal_blank_1.jpg), count=count+1 End If Next set shell=nothing set objFSO=nothing WScript.quit Sub pano (f1) concat = panout & "\" & head(f1) & "_" & head(H:\horizontal_blank_1.jpg) & panextn filestring = "2," & f1 ' horizontal=1 , vertical=2 shell.Run Appcall & "/panorama=("& filestring & ") /convert=" & concat ,2 ,true ' wscript.echo concat End sub Function head(name) head=left(name, instr(name, ".")-1) name= process & "\" & name End function
dim shell, fso
Dim f, folderlist, item, File(4), process, panout, Irfanview, Appcall
Dim mask, test, dot, extn, count
set fso = CreateObject("Scripting.FileSystemObject")
set shell = createObject("WScript.shell")
'Defaults
Irfanview = "C:\Program files\Irfanview\i_view32.exe" 'location of irfanview application
mask = "jpg,png,gif" 'files to process inside folder
panextn = ".jpg" 'file type for panoramas
If wscript.arguments.count = 0 then
msgbox "No folder selected" : wscript.quit
else
process = wscript.arguments(0)
end if
Appcall = chr(34) & Irfanview & chr(34) & " "
panout= process & "\panoramas"
if fso.FolderExists(panout) = false then fso.CreateFolder(panout)
Set f = fso.GetFolder(process)
Set folderlist = f.Files
Count=1
For Each item in folderlist
test= item.name : dot=InstrRev(test,".")
if dot >1 and len(test)-dot >1 then extn = mid(test,dot+1) else extn = "none"
if instr(1,mask,extn,1) >0 then
File(count) = test
If count=3 then count=0 : pano File(1), File(2), File(3)
count=count+1
End If
Next
set shell=nothing
set objFSO=nothing
WScript.quit
Sub pano (f1,f2,f3)
concat = panout & "\" & head(f1) & "_" & head(f2) & "_" & head(f3) & panextn
filestring = "1," & f1 & "," & f2 & "," & f3 ' horizontal=1 , vertical=2
shell.Run Appcall & "/panorama=("& filestring & ") /convert=" & concat ,2 ,true
' wscript.echo concat
End sub
Function head(name)
head=left(name, instr(name, ".")-1)
name= process & "\" & name
End function
Code:#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. ; #Warn ; Enable warnings to assist with detecting common errors. SendMode Input ; Recommended for new scripts due to its superior speed and reliability. SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory. sleep, 400 Send {F2} sleep, 100 send ^c sleep, 100 send {Esc} sleep, 200 Send {AppsKey} sleep, 100 send H sleep, 100 Send {down} Send {enter} sleep, 200 Send !I sleep, 100 send P sleep, 100 send {Tab 5} sleep, 100 Send {enter} send {Tab 9} sleep, 400 Send {enter} sleep, 200 send horizontal_blank_1.jpg sleep, 200 send !d send C:\Program Files\irfanview\Photos sleep, 100 sleep, 100 Send {enter} sleep, 100 Send {enter} sleep, 100 send !c sleep, 400 send {LAlt} sleep, 100 Send f sleep, 50 send v sleep, 200 send ^v sleep, 200 send {enter} sleep, 100 send y sleep, 200 send !{f4} sleep, 1000 send {right} sleep, 400
Comment
-
extension of vbs script by checking portrait or landscape mode
though this is a rather old thread, I would like to ask, if someone can show me, how to extend this VBS file.
What I need is the vbs code, to check if the picture in progress is a landscape or portrait picture to call then irfanview with appropriate parameters.
Probably, there are functions in VB to check this and then executed some additional irfanview commands before the procedure executes the pano function.
Thank you for any help.
pope5
Comment
Comment