Only read until the offset of the next tile by radarhere · Pull Request #8609 · python-pillow/Pillow

Resolves #8607

At the moment, ImageFile reads from files in MAXBLOCK chunks (unless pulls_fd is in use). There is no problem with this if there is only one tile. If there are multiple tiles however, that may be smaller than MAXBLOCK, then the size of the read operation can be reduced - by stopping the read operation before the next tile starts.