When I navigate to a directory and double click an image, it opens with Windows' Photos app (my default application). I can then scroll to the next or previous images with the scroll wheel or the arrows on either side of the window.
However, if I open an image from the explorer's search results, I cannot scroll to the next/previous image. Neither can I when I open an image programmatically. How can I open an image programmatically in Windows' Photo app so that it will allow me to scroll to the next/previous images?
I remember reading that, when opening from a folder, explorer passes the directory as an extra argument. I have not found any documentation on how exactly that happens. I have tried to replicate this programmatically (in Python) with no success. I have tried combinations such as:
import subprocess
subprocess.Popen('D:/path/img05.jpg', shell=True) # Test 1
subprocess.Popen(['D:/path/img05.jpg', 'D:/path'], shell=True) # Test 2
subprocess.Popen(['D:/path', 'D:/path/img05.jpg'], shell=True) # Test 3
subprocess.Popen('D:/path/img05.jpg', shell=True, cwd='D:/path') # Test 4
Some notes:
shell=True--> With this, the executable is the explorer. It will then choose the default application for the file.- I'm already being careful about spaces in paths by using double quotes:
'"D:/path to image/img05.jpg"' - This is specific to Photos app. Other image viewers (e.g. HoneyView) handle the problem correctly.
- Similar unresolved question for C++.