Open-Shell / Open-Shell-Menu

Classic Shell Reborn.
MIT License
7k stars 433 forks source link

Classic Explorer > Status Bar, should show selected image and video dimensions in network shares #850

Open daiplusplus opened 3 years ago

daiplusplus commented 3 years ago

Is your feature request related to a problem? Please describe.

This is how Classic Shell / Open Shell Explorer currently behaves with images in a network share on Windows 10:

image

This is how Classic Shell / Open Shell Explorer currently behaves with local images on Windows 10:

image

This happens regardless of the image type (JPEG, PNG, GIF, BMP, HEIF/HEIC). I haven't tested videos but I assume it's the same.

Describe the solution you'd like

I'd like the OpenShell File Explorer status bar to always show dimensions of selected images, regardless of their location.

Describe alternatives you've considered

None.

Additional context

Windows 10's File Explorer shows dimensions for remote files, so why doesn't OpenShell? (I know it requires reading the file, but for single image files under a few megabytes that shouldn't be an issue)

Gaurav-Original-ClassicShellTester commented 3 years ago

The status bar shows what the tooltip/infotip of File Explorer shows (determined in Windows Registry or by a shell extension DLL for specific file types). If you can get the tooltip shown by Windows for files on network share to show dimensions, the status bar will also show it.

daiplusplus commented 3 years ago

@Gaurav-Original-ClassicShellTester Interesting. I tested this out just now and yeah, you're right.

I found this interesting article which explains how the tooltips are configured: https://www.ghacks.net/2008/02/10/customize-windows-explorer-tooltips/ - and indeed I see the System.Image.Dimensions property listed in HKEY_CLASSES_ROOT\SystemFileAssociations\.jpg

image

I can't see any information about why this is disabled on network shares though... or how to configure it...

daiplusplus commented 3 years ago

After some more digging, I think it might be controlled by SFGAO_ISSLOW and/or FILE_ATTRIBUTE_OFFLINE - which would explain it: as Explorer will skip-over Windows Properties operations that are potentially painfully slow, which necessarily includes loading image data from SMB network shares.

https://docs.microsoft.com/en-gb/windows/win32/shell/sfgao

  • Accessing the item (through IStream or other storage interfaces) is expected to be a slow operation. Applications should avoid accessing items flagged with SFGAO_ISSLOW.
  • Opening a stream for an item is generally a slow operation at all times.
    • SFGAO_ISSLOW indicates that it is expected to be especially slow, for example in the case of slow network connections or offline (FILE_ATTRIBUTE_OFFLINE) files.
    • However, querying SFGAO_ISSLOW is itself a slow operation. Applications should query SFGAO_ISSLOW only on a background thread.
    • An alternate method, such as retrieving the PKEY_FileAttributes property and testing for FILE_ATTRIBUTE_OFFLINE, could be used in place of a method call that involves SFGAO_ISSLOW.

Now I need to figure out how to override it...