mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Jules Maselbas <jmaselbas@kalray.eu>
To: barebox@lists.infradead.org
Cc: Jules Maselbas <jmaselbas@kalray.eu>
Subject: [PATCH 1/5] filetype: Add QOI format image type
Date: Mon, 10 Jan 2022 23:12:51 +0100	[thread overview]
Message-ID: <20220110221255.5003-2-jmaselbas@kalray.eu> (raw)
In-Reply-To: <20220110221255.5003-1-jmaselbas@kalray.eu>

QOI image format is a "Quite OK" image format, it's simplicity is it's
strength and could be a good replacement of bmp, maybe even for png.

Signed-off-by: Jules Maselbas <jmaselbas@kalray.eu>
---
 common/filetype.c  | 3 +++
 include/filetype.h | 1 +
 2 files changed, 4 insertions(+)

diff --git a/common/filetype.c b/common/filetype.c
index 8ffcd6adcd..e5245668e2 100644
--- a/common/filetype.c
+++ b/common/filetype.c
@@ -45,6 +45,7 @@ static const struct filetype_str filetype_str[] = {
 	[filetype_mbr] = { "MBR sector", "mbr" },
 	[filetype_bmp] = { "BMP image", "bmp" },
 	[filetype_png] = { "PNG image", "png" },
+	[filetype_qoi] = { "QOI image", "qoi" },
 	[filetype_ext] = { "EXT filesystem", "ext" },
 	[filetype_gpt] = { "GUID Partition Table", "gpt" },
 	[filetype_ubifs] = { "UBIFS image", "ubifs" },
@@ -300,6 +301,8 @@ enum filetype file_detect_type(const void *_buf, size_t bufsize)
 		return filetype_aimage;
 	if (buf64[0] == le64_to_cpu(0x0a1a0a0d474e5089ull))
 		return filetype_png;
+	if (strncmp(buf8, "qoif", 4) == 0)
+		return filetype_qoi;
 	if (is_barebox_mips_head(_buf))
 		return filetype_mips_barebox;
 	if (buf[0] == be32_to_cpu(0x534F4659))
diff --git a/include/filetype.h b/include/filetype.h
index 2640847e1f..8bc179ac08 100644
--- a/include/filetype.h
+++ b/include/filetype.h
@@ -28,6 +28,7 @@ enum filetype {
 	filetype_mbr,
 	filetype_bmp,
 	filetype_png,
+	filetype_qoi,
 	filetype_ext,
 	filetype_gpt,
 	filetype_ubifs,
-- 
2.17.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


  reply	other threads:[~2022-01-10 22:15 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-10 22:12 [PATCH 0/5] Add support for QOI image format Jules Maselbas
2022-01-10 22:12 ` Jules Maselbas [this message]
2022-01-14  9:00   ` [PATCH 1/5] filetype: Add QOI format image type Ahmad Fatoum
2022-01-10 22:12 ` [PATCH 2/5] gui: Add qoi image format Jules Maselbas
2022-01-14 10:05   ` Ahmad Fatoum
2022-01-14 10:54     ` Jules Maselbas
2022-01-10 22:12 ` [PATCH 3/5] scripts: Add qoiconv to convert png to qoi Jules Maselbas
2022-01-14 10:29   ` Ahmad Fatoum
2022-01-14 11:14     ` Jules Maselbas
2022-01-17 11:48       ` Ahmad Fatoum
2022-01-10 22:12 ` [PATCH 4/5] logo: Enable image format selection for the logo Jules Maselbas
2022-01-10 22:12 ` [PATCH 5/5] logo: Add choice for the QOI image format option Jules Maselbas
2022-01-14 10:28 ` [PATCH 0/5] Add support for QOI image format Ahmad Fatoum

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220110221255.5003-2-jmaselbas@kalray.eu \
    --to=jmaselbas@kalray.eu \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox