mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Jules Maselbas <jmaselbas@kalray.eu>
To: Ahmad Fatoum <a.fatoum@pengutronix.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH 2/5] gui: Add qoi image format
Date: Fri, 14 Jan 2022 11:54:51 +0100	[thread overview]
Message-ID: <20220114105451.GA29876@tellis.lin.mbt.kalray.eu> (raw)
In-Reply-To: <0ca90254-a1d1-7151-0236-4dd92ee4d620@pengutronix.de>

On Fri, Jan 14, 2022 at 11:05:15AM +0100, Ahmad Fatoum wrote:
> On 10.01.22 23:12, Jules Maselbas wrote:
> 
> Could you add a link there the project is from, what version
> you're importing. Perhaps how to update them in the future?
> (Do we touch the header, or is it just some macros we define
> outside).
ok, I'll amend the commit message with the following information:
The project home page can be found at https://qoiformat.org with
a single header file reference implementation of encoder/decoder
that is currently hosted at https://github.com/phoboslab/qoi.
There is no plan for future version, this is a frozen format.

> > diff --git a/lib/gui/qoi.c b/lib/gui/qoi.c
> > new file mode 100644
> > index 0000000000..f6c1bc1b94
> > --- /dev/null
> > +++ b/lib/gui/qoi.c
> 
> License statement missing.
ok

> > +
> > +	pr_debug("qoi: %d x %d  x %d data@0x%p\n", img->width, img->height,
> > +		 img->bits_per_pixel, img->data);
> 
> Nitpick: You can define a common prefix
> with pr_fmt at the top of the file, e.g
> 
> #define pr_fmt(fmt) "qoi: " fmt
sure will do

> > +	return img;
> > +}
> > +
> > +static void qoi_close(struct image *img)
> > +{
> > +	free(img->data);
> 
> Curious API that open() is allocating, but close's caller is
> the one resposible for freeing. Should probably be fixed up.
> 
> > +static struct image_renderer qoi = {
> > +	.type = filetype_qoi,
> > +	.open = qoi_open,
> > +	.close = qoi_close,
> > +	.renderer = qoi_renderer,
> > +	.keep_file_data = 1,
> 
> Do you really need this? For bmp, it makes sense, because the pixel data isn't
> compressed, so there are direct pointers into it. But if you uncompress into a
> newly allocated buffer, you should not need to keep (and leak) inbuf's content
> 
You're right, I haven't look at what .keep_file_data was for and, it is
indeed not needed.

> > +};
> > +
> > +static int qoi_init(void)
> > +{
> > +	return image_renderer_register(&qoi);
> > +}
> > +fs_initcall(qoi_init);
> > diff --git a/lib/gui/qoi.h b/lib/gui/qoi.h
> > new file mode 100644
> > index 0000000000..988f9edcb4
> > --- /dev/null
> > +++ b/lib/gui/qoi.h
> > @@ -0,0 +1,671 @@
> > +/*
> > +
> > +QOI - The "Quite OK Image" format for fast, lossless image compression
> > +
> > +Dominic Szablewski - https://phoboslab.org
> > +
> > +
> > +-- LICENSE: The MIT License(MIT)
> 
> Can you turn this into a SPDX-License-Identifier: please?
ok

> > +
> > +Copyright(c) 2021 Dominic Szablewski
> > +
> > +Permission is hereby granted, free of charge, to any person obtaining a copy of
> > +this software and associated documentation files(the "Software"), to deal in
> > +the Software without restriction, including without limitation the rights to
> > +use, copy, modify, merge, publish, distribute, sublicense, and / or sell copies
> > +of the Software, and to permit persons to whom the Software is furnished to do
> > +so, subject to the following conditions :
> > +The above copyright notice and this permission notice shall be included in all
> > +copies or substantial portions of the Software.
> > +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> > +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> > +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE
> > +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
> > +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
> > +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
> > +SOFTWARE.
> > +





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


  reply	other threads:[~2022-01-14 10:56 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 " Jules Maselbas
2022-01-10 22:12 ` [PATCH 1/5] filetype: Add QOI format image type Jules Maselbas
2022-01-14  9:00   ` 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 [this message]
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=20220114105451.GA29876@tellis.lin.mbt.kalray.eu \
    --to=jmaselbas@kalray.eu \
    --cc=a.fatoum@pengutronix.de \
    --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