Skip to content

fix(utility): resolve Windows path handling bugs breaking EXR sequence loading#225

Closed
throb wants to merge 1 commit intoAcademySoftwareFoundation:mainfrom
throb:fix/windows-path-handling
Closed

fix(utility): resolve Windows path handling bugs breaking EXR sequence loading#225
throb wants to merge 1 commit intoAcademySoftwareFoundation:mainfrom
throb:fix/windows-path-handling

Conversation

@throb
Copy link
Copy Markdown

@throb throb commented Mar 12, 2026

Summary

  • Broken backslash regex in scan_posix_path(): The character class [\] matched ] instead of \, leaving backslashes in scanned file paths on Windows. Fixed to use \\ for proper backslash matching.
  • pad_size() returned 0 for non-zero-padded frame numbers: e.g. frame "1000" produced invalid %00d / {:00d} format specifiers that failed extension matching in is_file_supported(). Now returns the natural width of the frame string.
  • posix_path_to_uri() did not normalise backslashes on Windows: Backslashes leaked into file: URIs. Added #ifdef _WIN32 block to replace \ with / before URI construction.

Files changed

  • src/utility/src/helpers.cpp — regex fix + URI backslash normalisation
  • src/utility/src/sequence.cpppad_size() fix

Test plan

  • Load an EXR image sequence from a Windows path with backslashes
  • Verify frame numbers without zero-padding (e.g. image.1000.exr) resolve correctly
  • Confirm no regression on Linux/macOS path handling

🤖 Generated with Claude Code

…e loading

Three issues prevented image sequences (EXR, etc.) from loading on Windows:

1. Broken backslash regex in scan_posix_path() - the character class [\]
   matched ']' instead of '\', leaving backslashes in scanned file paths.
2. pad_size() returned 0 for non-zero-padded frame numbers (e.g. "1000"),
   producing invalid %00d / {:00d} format specifiers that failed extension
   matching in is_file_supported().
3. posix_path_to_uri() did not normalise backslashes to forward slashes on
   Windows, leaking them into file: URIs.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@linux-foundation-easycla
Copy link
Copy Markdown

linux-foundation-easycla bot commented Mar 12, 2026

CLA Signed
The committers listed above are authorized under a signed CLA.

  • ✅ login: throb / name: Robert Nederhorst (b3b66c8)

@tedwaine
Copy link
Copy Markdown
Contributor

Hi @throb - thanks for this PR. We have crossed over on this as we (DNEG team) fixed this issue on our branch recently and I have just merged this into the develop & main branches here. Sorry about that.

@tedwaine tedwaine closed this Mar 24, 2026
@throb
Copy link
Copy Markdown
Author

throb commented Mar 24, 2026 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants