sylikc / jpegview

Fork of JPEGView by David Kleiner - fast and highly configurable viewer/editor for JPEG, BMP, PNG, WEBP, TGA, GIF and TIFF images with a minimal GUI. Basic on-the-fly image processing is provided - allowing adjusting typical parameters as sharpness, color balance, rotation, perspective, contrast and local under-/overexposure.
Other
2.22k stars 128 forks source link

Add LongPathAware Manifest #328

Open dbeinder opened 3 months ago

dbeinder commented 3 months ago

Starting from Windows 10, paths can be longer than 260 chars, but apps must declare that they are able to handle it, otherwise _tfopen will fail for those files: https://learn.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation?tabs=registry#application-manifest-updates-to-declare-long-path-capability

I have done a quick test, and it seems to work fine, but I'm not familiar enough with the codebase to confidently add a PR for it. https://github.com/dbeinder/jpegview/commit/b35e15c89f333b9b83c209d3988455d4a9b4abb9#diff-163478135344e1ca85e5f1f587940bdeea4beb3a149510970c22ae1c416d7330

sylikc commented 2 months ago

Hmm, this might add a feature... I didn't realize the apps have to declare it.

When you say you've done a quick test... did you name your exe test.exe and include the test.exe.manifest along side it?

dbeinder commented 2 months ago

I tested it by embedding the manifest into the exe during build: TOQ9l You may need to enable long paths on your machine if it has been disabled: https://stackoverflow.com/a/71603209/4371382