From c6fb90fa6e6a996a77e16238bf8036076a67f9f6 Mon Sep 17 00:00:00 2001 From: PandorasPalette Date: Tue, 26 May 2026 21:11:56 -0400 Subject: [PATCH 1/2] Add OIIO_NODISCARD_ERROR to ImageInput::open overloads --- src/include/OpenImageIO/imageio.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/include/OpenImageIO/imageio.h b/src/include/OpenImageIO/imageio.h index 82fa598969..d2b6da00ce 100644 --- a/src/include/OpenImageIO/imageio.h +++ b/src/include/OpenImageIO/imageio.h @@ -985,12 +985,12 @@ class OIIO_API ImageInput { /// A `unique_ptr` that will close and free the ImageInput when /// it exits scope or is reset. The pointer will be empty if the /// required writer was not able to be created. - static unique_ptr open (const std::string& filename, + OIIO_NODISCARD_ERROR static unique_ptr open (const std::string& filename, const ImageSpec *config = nullptr, Filesystem::IOProxy* ioproxy = nullptr); /// Create and open an ImageInput using a UTF-16 encoded wstring filename. - static unique_ptr open (const std::wstring& filename, + OIIO_NODISCARD_ERROR static unique_ptr open (const std::wstring& filename, const ImageSpec *config = nullptr, Filesystem::IOProxy* ioproxy = nullptr) { return open(Strutil::utf16_to_utf8(filename), config, ioproxy); From b2065ca8f2dab2eeb396834aa9700786eb7a3dab Mon Sep 17 00:00:00 2001 From: PandorasPalette Date: Wed, 27 May 2026 20:14:12 -0400 Subject: [PATCH 2/2] Add OIIO_NODISCARD to ImageInput::open overloads --- src/include/OpenImageIO/imageio.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/include/OpenImageIO/imageio.h b/src/include/OpenImageIO/imageio.h index d1f4c4b353..4caf02eae4 100644 --- a/src/include/OpenImageIO/imageio.h +++ b/src/include/OpenImageIO/imageio.h @@ -985,12 +985,12 @@ class OIIO_API ImageInput { /// A `unique_ptr` that will close and free the ImageInput when /// it exits scope or is reset. The pointer will be empty if the /// required writer was not able to be created. - OIIO_NODISCARD_ERROR static unique_ptr open (const std::string& filename, + OIIO_NODISCARD static unique_ptr open (const std::string& filename, const ImageSpec *config = nullptr, Filesystem::IOProxy* ioproxy = nullptr); /// Create and open an ImageInput using a UTF-16 encoded wstring filename. - OIIO_NODISCARD_ERROR static unique_ptr open (const std::wstring& filename, + OIIO_NODISCARD static unique_ptr open (const std::wstring& filename, const ImageSpec *config = nullptr, Filesystem::IOProxy* ioproxy = nullptr) { return open(Strutil::utf16_to_utf8(filename), config, ioproxy); @@ -1143,10 +1143,10 @@ class OIIO_API ImageInput { /// /// @returns /// `true` upon success, or `false` upon failure. - virtual bool valid_file (const std::string& filename) const; + OIIO_NODISCARD_ERROR virtual bool valid_file (const std::string& filename) const; /// Check valid file using a UTF-16 encoded wstring filename. - bool valid_file (const std::wstring& filename) const { + OIIO_NODISCARD_ERROR bool valid_file (const std::wstring& filename) const { return valid_file(Strutil::utf16_to_utf8(filename)); }