Announcement

Collapse
No announcement yet.

Spacing panorama images

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Spacing panorama images

    Some time ago I was looking to join images (comic strips) and ended up finding some precious information and at the same time I got to know Irfanview.
    This precious information was a small Vbs script, which gathered 3 images in a single image horizontal or vertically using naturally Irfanview.
    Performed by the "Professional User Mij", I dedicated myself to try to change the script to the merge not of three, but of two images, which I manage to.

    The script went like this:

    **************************************************

    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:\Programas\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=2 then count=0 : pano File(1), File(2)
    count=count+1
    End If
    Next

    set shell=nothing
    set objFSO=nothing
    WScript.quit

    Sub pano (f1,f2)
    concat = panout & "" & head(f1) & "_" & head(f2) & panextn
    filestring = "2," & f1 & "," & f2 ' 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

    **************************************************


    I'm missing a small situation, which I don't know if you can help, which is to create a space between the two images of about 25 pixels.

    I know that in the "image - create panorama" I can do this for every two images, but the idea is to work with a large amount of images.

    Above all, thank you very much

    #2
    Any help, please?

    Comment


      #3
      I can't find a command-line function to increase the canvas size.

      So all I can come up with is this: create an image, let's call it spacer25.jpg, that has a width of 25 pixels and the same height as the the images you want to join into a panorama.

      Then create your panorama by alternately concatenating your images and spacer25.jpg
      Last edited by jazzman; 18.06.2020, 07:05 PM.

      currently running 4.56 / 32 bit

      Comment


        #4
        Thank you very much in advance for your answer.

        I start by saying that I don't know anything about VBS, but the first thing I thought was the possibility that at the time of the concatenation of the images, if I could add an image that I already created (a blank image with 200x25 pixels) would be the solution.

        In the line:

        If count=2 then count=0 : pano File(1), File(2)

        I think it's the moment when the images are put together, if I could add an image located in a sub-directory it would be ideal.

        I changed that line to:

        If count=2 then count=0 : pano File(1),c:\tempus\alfa\espaco.jpg,File(2)


        But that's precisely were the error appears.

        That's why my cry for help.
        I'm hoping that someone with VBS knowledge might be able to help.
        Thank you
        Last edited by ar01; 19.06.2020, 10:57 PM. Reason: errors

        Comment


          #5
          Any help, please?

          Comment

          Working...
          X