Skip to content

Commit 1cd674f

Browse files
jessey-gitlgritz
authored andcommitted
fix(oiiotool): Use normalized path when creating wildcard path pattern (AcademySoftwareFoundation#4904)
On Windows, using a wildcard input path containing `\` back slashes would lead to failures because it would be compared with file paths containing `/` forward slashes. Use the existing `Filesystem::generic_filepath` API (which calls `path::generic_string`) to get a normalized path containing consistent directory separators. An example of the existing failure: ``` .\oiiotool.exe -v t:\render\foo_#.png --resize 160x90 -o t:\smaller_#.png oiiotool WARNING : No frame number or views matched the wildcards oiiotool ERROR: read : File does not exist: "t:\render\foo_#.png" Full command line was: > oiiotool.exe -v t:\\render\\foo_#.png --resize 160x90 -o t:\\smaller_#.png ``` Workaround - without this PR you would have to use an input path containing `/`: ``` .\oiiotool.exe -v t:/render/foo_#.png --resize 160x90 -o t:\smaller_#.png Reading t:/render/foo_0001.png Writing t:\smaller_0001.png Reading t:/render/foo_0002.png Writing t:\smaller_0002.png ``` Signed-off-by: Jesse Yurkovich <jesse.y@gmail.com>
1 parent 389903f commit 1cd674f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/libutil/filesystem.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -911,7 +911,7 @@ Filesystem::parse_pattern(const char* pattern_, int framepadding_override,
911911

912912
// std::cout << "Format: '" << fmt << "'\n";
913913

914-
normalized_pattern = prefix + fmt + suffix;
914+
normalized_pattern = Filesystem::generic_filepath(prefix + fmt + suffix);
915915
framespec = thesequence;
916916

917917
return true;

0 commit comments

Comments
 (0)