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@xxxxxxxxxxxxxxxxxxx http://lists.infradead.org/mailman/listinfo/barebox