1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 22:57:44 +00:00

LibGfx: Return bool not ErrorOr<bool> from ImageDecoderPlugin::sniff()

Nobody made use of the ErrorOr return value and it just added more
chance of confusion, since it was not clear if failing to sniff an
image should return an error or false. The answer was false, if you
returned Error you'd crash the ImageDecoder.
This commit is contained in:
MacDue 2023-02-26 18:02:50 +00:00 committed by Andreas Kling
parent 8d9cb538d6
commit 6cf8eeb7a4
22 changed files with 40 additions and 40 deletions

View file

@ -656,7 +656,7 @@ bool DDSImageDecoderPlugin::initialize()
&& m_context->data[3] == 0x20;
}
ErrorOr<bool> DDSImageDecoderPlugin::sniff(ReadonlyBytes data)
bool DDSImageDecoderPlugin::sniff(ReadonlyBytes data)
{
// The header is always at least 128 bytes, so if the file is smaller, it can't be a DDS.
return data.size() > 128