From f206e09106a43be93ef02fcb03edaed8b9fb352e Mon Sep 17 00:00:00 2001 From: Adam Mains Date: Thu, 21 Dec 2023 14:40:22 -0600 Subject: [PATCH] Only check REST arguments if the file does not exist Signed-off-by: AdamMainsTL --- src/libOpenImageIO/imageioplugin.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/libOpenImageIO/imageioplugin.cpp b/src/libOpenImageIO/imageioplugin.cpp index 2c62b853e5..92be70034a 100644 --- a/src/libOpenImageIO/imageioplugin.cpp +++ b/src/libOpenImageIO/imageioplugin.cpp @@ -649,10 +649,14 @@ ImageInput::create(string_view filename, bool do_open, const ImageSpec* config, std::unique_ptr in; std::map args; std::string filename_stripped; - if (!Strutil::get_rest_arguments(filename, filename_stripped, args)) { - OIIO::pvt::errorfmt( - "ImageInput::create() called with malformed filename"); - return in; + + // Only check REST arguments if the file does not exist + if (!Filesystem::exists(filename)) { + if (!Strutil::get_rest_arguments(filename, filename_stripped, args)) { + OIIO::pvt::errorfmt( + "ImageInput::create() called with malformed filename"); + return in; + } } if (filename_stripped.empty())