GP SoftwareTwitter
Opus FAQsManualCommandsObjects

Display two pictures side by side in Standalone viewer


#1

If you are a photographer who does a lot of detailed photo-editing, it is extremely useful to be be able to view the before and after results of your efforts without the fag of having to have two Photoshop windows open.

The little script here will do just that. You select the two images you want to compare and they appear next to each other in separate Standalone viewer windows

I have attached a Close button to the toolbar of my Standalone Viewer, which closes both windows and brings the latest Lister to the front

Two Images In Viewer.dcf (2.8 KB)

Close.dcf (829 Bytes)

To get the two viewer windows next to each other you will have to experiment with the minimum width window of the viewer to suit your video set-up. Although those who are much better at scripts that I am will no doubt be able to discover the right co-ordinate of the first window and place the second widow close to that co-ordinate.

Also depending on your video set-up you may need to edit line 34 of the script to set the left co-ordinate of the second window. (Unless you are clever enough to get the system to work it out for you)

I have found this little script saves me so much time.


Dual or more than one viewer panel?
#2

Thanks for the inspiration!

A bit of feedback:

  • The first picture always gets loaded twice. Delete the first ClickData.Func.command.Run to take care of this.

  • To have more control over the viewers, add SIZE to the Show command.

  • There is a slightly easier way to address the selected files :wink:

Function OnClick(ByRef clickData)
    If clickData.func.sourcetab.selected_files.count <> 2 Then
        Msgbox "Please select two files."
        Exit Function
    End If

    For Each v in DOpus.Viewers
        v.Command("close")
    Next

    ClickData.Func.Command.AddLine("Show """ & ClickData.Func.sourcetab.selected_files(0) & """ POS 3120,0 SIZE 1200,960 NOUSEEXISTING")
    ClickData.Func.Command.AddLine("Show """ & ClickData.Func.sourcetab.selected_files(1) & """ POS 3120,960 SIZE 1200,960 NOUSEEXISTING")
    ClickData.Func.Command.Run
End Function

#3

@Ixp
Yes. I realised that the first picture was getting loaded twice, but I haven't had time to post a correction.

I take your point about the control of the viewer window, but as I use the feature solely for comparing before and after edits in portraits, I have found that if I set the viewer to FIT EVERY PICTURE and then give each picture a fixed width, it is ideal.

What would be nice would be to display the first viewer window, get the value of it top right co-ordinates and use them to display the second window, but as you will have gathered, writing VB is like drawing teeth for me, so I can't work out how to do it.


#4

That's why I added SIZE. It refers to the size of the viewers, not the pictures.

If your monitor was 1600x1200, you would use POS 0,0 SIZE 800,1200 for left viewer and POS 800,0 SIZE 800,1200 for the right one.


#5

@Ixp
Your solution seems to give a neater solution most of the time. Thanks for the tip. I have to say I find this a very handy feature to have.


#6

Up to now, on a single-monitor sysem I've just been opening two instances of the standalone viewer and flicking between their full-screen windows to compare. But maybe I'll give this a spin...


#7

Here is a new version of the View Two Images button, with a correction to the problem of displaying an extra picture and the positioning suggestions from Ixp

Compare Images In Viewer.dcf (3.1 KB)


#8

Here is a new version of the View Two images macro. It contains far more robust error checking, but the functionality is the same. Feel free to adapt to your needs.

Compare Images In Viewer.dcf (4.0 KB)

Close.dcf (829 Bytes)