Fix RGBHandler::canRead
ClosedPublic

Authored by aacid on Mar 31 2019, 5:25 PM.

Details

Summary

As one can see in SGIImage::readImage the accepted images are

_stream >> u16;
if (u16 != 0x01da) {
    return false;
}

_stream >> _rle;
if (_rle > 1) {
    return false;
}

so not only \x01\xda\x01 but also \x01\xda\x00

Diff Detail

Repository
R287 KImageFormats
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 10305
Build 10323: arc lint + arc unit
aacid created this revision.Mar 31 2019, 5:25 PM
Restricted Application added a project: Frameworks. · View Herald TranscriptMar 31 2019, 5:25 PM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
aacid requested review of this revision.Mar 31 2019, 5:25 PM
svuorela accepted this revision.Mar 31 2019, 5:38 PM
svuorela added a subscriber: svuorela.

I'm not sure why it as such is needed, but it isn't wrong.

This revision is now accepted and ready to land.Mar 31 2019, 5:38 PM
apol accepted this revision.Mar 31 2019, 6:10 PM
apol added a subscriber: apol.

Makes sense, maybe it would make sense to include a test case? if such a thing exists...

aacid added a comment.Mar 31 2019, 6:57 PM
In D20145#441079, @apol wrote:

Makes sense, maybe it would make sense to include a test case? if such a thing exists...

We already have tests cases, it just does not use canRead, only read. I need this fixed so i can make the test use canRead too

This revision was automatically updated to reflect the committed changes.