External viewer loads only one Image (unable to browse forwards)

Hello, I have a problem and would like to know if there is a solution for it.

When using external picture viewer, it only opens it without the function to navigate the other images inside the directory.
This makes it (for me) almost impossible to use the feature to disable the internal picture viewer.
This is not a problem with the windows photo viewer because it accures also with other picture viewers.
I think that the opening of the images is controlled by explorer.exe, which then selects the default viewer.
Maybe instead of parsing only the single file, the whole folder must be tried to open.
But I don't think you could use explorer.exe to do that, you would have to go directly to the Picture Viewer.
Maybe I could work if it was possible to select the application you want to open images or whole directories.

I found an old post from 2016, talking about it, without any solutions.

Did anything change since 2016 or is there a way to fix this?

Which picture viewer?

It’s up to the viewer to list the folder contents. The Windows one won’t do it by itself when launched by anything other than Explorer, which is a flaw in the Windows viewer. You’ll see the same problem if you pass it a filename via a Windows Command Prompt.

I’m not aware of any other viewer that has the same flaw, other than ones which never build a list of other files even from Explorer.

I was using Pictureflect.
The navigation is also only working in the explorer.

Because the navigation feature didnt work on both Windows photo viewer and Pictureflect, I assumed, it has something to do with parsing the folder contents.

In C# you can define a "WorkingDirectory" when starting a process. I thought, that something like this could fix it. But its just a wild guess

Opus sets the current directory to System32 by default, as it is more secure against DLL planting attacks to do that. Viewers should work relative to the path of the picture they're asked to load rather than the current directory, but maybe not all do.

See what happens if you open a Command Prompt, cd to the directory with photos, and run the viewer on one of the photos from there. If that works and builds a list of other files in the folder, the viewer is probably using the current directory, and we can go into how to make Opus work with that as well. But if it doesn't work then the viewer may be pulling the file list out of the Explorer window, like the Windows Photo Viewer seems to do, which will only work with Explorer.

1 Like

Thank you very much for your Answer!
You're explanation helped alot. I've reached out to Pictureflect.

When opening an Image with the application through cmd the navigation does not work. So it seems to be a problem with the application and not Directory Opus.

1 Like

I'm having the exact same problem as the above user (also using Pictureflect)
I was having issues with another file explorer "One Commander"

Actually came across a Twitter thread where the devs of Pictureflect and One Commander talk about the issue, something about "NeighboringFilesQuery" or "BroadFileSystemAccess"

Twitter thread here: https://twitter.com/onecommander/status/1595878395442872320

Oddly, the full list of images loads when you open a picture in the Picture's folder, but not anywhere on the hard drive.

This issue is honestly driving me crazy because I can't find an external file browser that works with Pictureflect, outside of Qttabar (which has other issues)

There’s no reason an image viewer can’t list the other files in the directory itself.

That’s what the Opus image viewer does if it’s launched by another program.

I've asked Pictureflect and their response is, that the problem lies in Directory Opus, but I doubt it.
The only solution they gave me to workaround this problem, is the same as @sodium.777 mentioned.

"This is actually because Pictureflect is a UWP app.
Technically it’s up to Directory Opus to provide a neighboring files query to the app, although it is a little awkward.
One thing you can do as a workaround is in Pictureflect, go to Settings > App launch, and change ‘Neighboring files option’ to ‘Load whole folder if possible, but use neighboring files list if present’. However, for this to work, the folder must be in your Pictures or Videos library (due to permissions restrictions for UWP apps).
You can Google how to add a folder to a library."

Sounds very limited. I don’t know why anyone would make, or want to use, a UWP app when they are prevented from such basic functionality or working without special help by the thing launching them.

And a viewer should work if run from a Command Prompt, let alone any other method.

We have made a note to look at this API to see if we can make things work better where possible, but IMO UWP viewers (and UWP generally) are not fit for purpose.

If it only works with files in libraries, even with the launcher using this API, then it barely seems worth it. Microsoft have deprecated the Libraries concept quite heavily in Windows 11, so it’s unlikely most users are adding all their folders to Libraries, and even then there will always be folders of pictures (e.g. new downloads) which people want to view outside any Library.

Yes I also find this solution quite unpractical.

This was another response of them:

Well UWP apps are a special case because of the permissions restrictions imposed upon them. If the opening app uses the launcher API - Launcher.LaunchUriAsync Method (Windows.System) - Windows UWP applications | Microsoft Learn – and passes a NeighboringFilesQuery in the options, then that will work for any folder.

They gave me another possible way to fix it. I haven't tested it yet. Would something like this work?

Are you able to tell Directory Opus to invoke a special command line when opening a file?
For example, if you are able to get it to run pictureflect-photo-viewer.exe --neighbors=2 filepath (or just pictureflect-photo-viewer.exe filepath if you have changed the neighboring files option in Pictureflect as I suggested), and if you are able to get Directory Opus to set the current working directory to the folder containing the file or a parent folder, then it should work.
However, note that the last part is essential because that is what gives the app permission to access the folder (again, this is something specific to UWP apps).

Thank you very much for your responses and effort, Leo!

pictureflect-photo-viewer.exe --neighbors=2 filepath

I know it's quite late, but to anyone who's using Pictureflect, you can do this in DO to open the images

  1. Click on Settings > File Types
  2. Go to File Type Groups > Double click on Images > Commands tab > Left double-click & Edit
  3. Choose MS-DOS Batch Function and in the code block type this
@runmode hide
pictureflect-photo-viewer --neighbors=2 {file}

Click OK and now test opening images again. It won't open as fast as before but you can navigate through the images now.