QTiffHandler: Extract Method Private::readNextImage() from read()


This allows to centralize the Private::close() call in read(), instead
of having every early return execute it manually, which one return
already forgot (fixed in a prequel commit).

I also considered simply adding a qScopeGuard([&] { d->close(); }),
but a traditional Extract Method seemed more productive, as it reduces
the size of the already-large function and separates concerns, instead
of adding another few lines, and leaving concerns entangled.

Amends the addition of the TIFF plugin to qtimageformats, from qtbase
(5.0), but made more urgent by adding support for more and more
formats over time.

Pick-to: 6.12 6.11 6.8
Change-Id: I641103b2a2e2f22340066802d64d286d8242fde2
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
commitbdda42e9ec461b17d873b2e11719dcd33577d032
parente4a5ff139d440034b44c075a58ad69ac34bf4206
authorMarc Mutz <marc.mutz@qt.io>
committerMarc Mutz <marc.mutz@qt.io>
commit timeFri, 24 Jul 2026 06:35:17 +0000