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

LibGfx: Add support for "The Quite OK Image Format" (QOI)

The spec had its first stable release today, so I figured we should
support it as well!
As usual, by using the regular LibGfx image decoder plugin architecture,
we immediately get support for it everywhere: ImageViewer, FileManager
thumbnails, PixelPaint, and (with a small change in the subsequent
commit) even the Browser :^)
This commit is contained in:
Linus Groh 2021-12-21 01:17:13 +01:00
parent 102e0af867
commit 0356ee95bc
5 changed files with 353 additions and 1 deletions

View file

@ -14,6 +14,7 @@
#include <LibGfx/PGMLoader.h>
#include <LibGfx/PNGLoader.h>
#include <LibGfx/PPMLoader.h>
#include <LibGfx/QOILoader.h>
namespace Gfx {
@ -61,6 +62,10 @@ RefPtr<ImageDecoder> ImageDecoder::try_create(ReadonlyBytes bytes)
if (plugin->sniff())
return plugin;
plugin = make<QOIImageDecoderPlugin>(data, size);
if (plugin->sniff())
return plugin;
return {};
}(data, size);