fix(imageio): ignore invalid RowsPerStrip chunking#5300
Conversation
Treat non-positive tiff:RowsPerStrip metadata as absent before using it to align generic scanline read/write chunks. Add regression coverage for an OpenEXR file carrying RowsPerStrip=0. Signed-off-by: Dongju Lee <dongpago2@gmail.com>
|
Where does the negative rps come from in the first place? The only place that is ever set is in tiffinput.cpp: So it looks like it will only be set if it's positive. OH, I see... it has to come in through an OpenEXR that cleverly includes metadata called "tiff:RowsPerStrip" set to a bad value. |
| command += run_app (pythonbin + " src/check-rowsperstrip-zero.py " | ||
| + oiio_app("iinfo") + " " + oiio_app("oiiotool"), | ||
| silent=True) |
There was a problem hiding this comment.
I'm wondering if we really need an extra .py file (code to maintain) instead of just directly running the two iinfo and one oiiotool tests here like we would for any other test? Are all of them necessary, or is any one enough to test that this issue has not regressed?
And I'm wondering about whether the test for this fix really fits best here in the "iinfo" test (it's not really testing an iinfo feature in particular) or if there is a different testsuite directory where it makes more sense.
Signed-off-by: Larry Gritz <lg@larrygritz.com>
|
I took the liberty of pushing an amendment to your PR that makes a separate test (and somewhat simpler) header of putting it into the iinfo test. If you think that is ok, I am prepared to merge it. |
|
LGTM |
This treats non-positive tiff:RowsPerStrip metadata as absent before using it to align generic scanline read/write chunks. That avoids feeding invalid chunking metadata into round_to_multiple while preserving normal positive RowsPerStrip behavior.
The patch adds regression coverage for an OpenEXR file carrying RowsPerStrip=0 through iinfo --hash, iinfo --stats, and an oiiotool conversion path.