Simplified read/verify header process

Where possible, QIODevice::peek has been used instead of transactions or instead of using ungetchar() for sequential access devices and seek() for random access devices.

Furthermore:
- RAS format gained the ability of read on sequential devices.
- Removed unused code in XCF (still related to ungetchar and sequential devices).
- These changes should prevent errors like the ones fixed by MR !258
This commit is contained in:
Mirco Miranda
2024-10-06 17:26:25 +00:00
committed by Albert Astals Cid
parent fee0165bef
commit 97120b2537
7 changed files with 51 additions and 180 deletions

View File

@ -121,10 +121,8 @@ public:
bool peek(QIODevice *d)
{
d->startTransaction();
auto ok = read(d);
d->rollbackTransaction();
return ok;
m_rawHeader = d->peek(512);
return isValid();
}
bool jumpToImageData(QIODevice *d) const