api: add OIIO_NODISCARD_ERROR to tiffutils.h#5215
Open
rose413 wants to merge 3 commits into
Open
Conversation
Add OIIO_NODISCARD_ERROR to the following functions in tiffutils.h to enforce that callers check their bool return values: - decode_exif - decode_iptc_iim - encode_iptc_iim - decode_xmp - decode_icc_profile Fix callers in tiffoutput.cpp, png_pvt.h, and webpinput.cpp that were previously ignoring return values. - Assisted-by: Claude Sonnet 4.6 Signed-off-by: rose413 <116857309+rose413@users.noreply.github.com>
lgritz
reviewed
May 27, 2026
| /// plugin. Note that IIM is actually considered obsolete and is | ||
| /// replaced by an XML scheme called XMP. | ||
| OIIO_API bool decode_iptc_iim (string_view iptc, ImageSpec &spec); | ||
| OIIO_NODISCARD_ERROR OIIO_API bool decode_iptc_iim (string_view iptc, ImageSpec &spec); |
Collaborator
There was a problem hiding this comment.
This line is fine, sorry, GitHub won't let me comment on lines that you don't change, so I have to put this here!
But another 4 lines down, there is a function that could use an OIIO_NODISCARD_ERROR that you didn't add.
Also somewhat above, the exif_tag_lookup and gps_tag_lookup functions.
… tiffutils.h - Annotate decode_exif, decode_iptc_iim, exif_tag_lookup , and gps_tag_lookup with OIIO_NODISCARD_ERROR. - Fix all call sites in png_pvt.h, tiffinput.cpp, and jpeginput.cpp - Assisted-by: Claude Sonnet 4.6 Signed-off-by: rose413 <116857309+rose413@users.noreply.github.com>
Collaborator
|
This seems to be failing most of the CI jobs. Is your GitHub fork set up with the option that allows ordinary pushes to your own fork (prior to submitting a PR) to trigger running the CI workflows? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Add OIIO_NODISCARD_ERROR to the following functions in tiffutils.h to enforce that callers check their bool return values:
Fix callers in tiffoutput.cpp, png_pvt.h, and webpinput.cpp that were previously ignoring return values.
Tests
Checklist:
and if I used AI coding assistants, I have an
Assisted-by: TOOL / MODELline in the pull request description above.
behavior.
PR, by pushing the changes to my fork and seeing that the automated CI
passed there. (Exceptions: If most tests pass and you can't figure out why
the remaining ones fail, it's ok to submit the PR and ask for help. Or if
any failures seem entirely unrelated to your change; sometimes things break
on the GitHub runners.)
fixed any problems reported by the clang-format CI test.
corresponding Python bindings. If altering ImageBufAlgo functions, I also
exposed the new functionality as oiiotool options.