Files
Marta Feriani de9eade170 docs: Conversion of ImageOutput docs to tests for the copy image example (#5197)
### Description

Convert C++ and Python example from the [ImageOutput: Copying an entire
image](https://openimageio.readthedocs.io/en/latest/imageoutput.html#copying-an-entire-image)
chapter into tests within the `docs-examples-{cpp,python}` test suites.
This was done following the steps outlined in [Converting documentation
examples to
tests](https://github.com/AcademySoftwareFoundation/OpenImageIO/wiki/Converting-documentation-examples-to-tests).

----
* This PR contributes to addressing issue
https://github.com/AcademySoftwareFoundation/OpenImageIO/issues/3992.
* This PR supersedes the closed PR
https://github.com/AcademySoftwareFoundation/OpenImageIO/pull/5195.
----

#### Notes

- In both `python` and `cpp` I have replaced the file
`{input,output}.jpg` mentioned in the example with `{input,output}.exr`
in the test, so to reuse existing resource files (i.e.
`testsuite/common/grid-small.exr`): do let me know if you prefer the
tests also use a `.jpg`, in which case I'll add a new resource to that
effect.
- The `cpp` example code was further modified to:
1. pass the requirements of `clang-format` (see original failing output
[here](https://github.com/demiaster/OpenImageIO/actions/runs/25871058187/job/76026144354))
  2. successfully run `ImageOutput.copy_image`
- The `python` example code was further modified to remove unnecessary
whitespace before the brackets of function calls.

Finally, when following the [conversion
docs](https://github.com/AcademySoftwareFoundation/OpenImageIO/wiki/Converting-documentation-examples-to-tests),
I have not addressed point `5`: again, let me know if you prefer to have
a positive fixture to compare the test output against.


### Tests

I have checked that, on my fork:
* The CI passes successfully:
https://github.com/demiaster/OpenImageIO/actions/runs/25888576608
* The docs build successfully:
https://github.com/demiaster/OpenImageIO/actions/runs/25888576599
* The replaced docs examples render correctly (see excerpt from above
build here:
[imageoutput.html](https://github.com/user-attachments/files/27781020/imageoutput.html))


Signed-off-by: Marta Feriani <marta.celeste.feriani@gmail.com>
2026-05-14 23:27:08 -07:00
..