mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: Jules Maselbas <jmaselbas@kalray.eu>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH 3/5] scripts: Add qoiconv to convert png to qoi
Date: Mon, 17 Jan 2022 12:48:25 +0100	[thread overview]
Message-ID: <cbfacecf-06b8-81d1-50cc-7398fd003903@pengutronix.de> (raw)
In-Reply-To: <20220114111404.GB29876@tellis.lin.mbt.kalray.eu>

On 14.01.22 12:14, Jules Maselbas wrote:
> On Fri, Jan 14, 2022 at 11:29:58AM +0100, Ahmad Fatoum wrote:
>> On 10.01.22 23:12, Jules Maselbas wrote:
>>> ImageMagick will eventually support the qoi image format, in the
>>> mean time add a png to qoi conversion program.
>>>
>>> Signed-off-by: Jules Maselbas <jmaselbas@kalray.eu>
>>> ---
>>>  scripts/Kconfig     |    5 +
>>>  scripts/Makefile    |    1 +
>>>  scripts/qoiconv.c   |   91 +
>>>  scripts/stb_image.h | 7756 +++++++++++++++++++++++++++++++++++++++++++
>>>  4 files changed, 7853 insertions(+)
>>>  create mode 100644 scripts/qoiconv.c
>>>  create mode 100644 scripts/stb_image.h
>>>
>>> diff --git a/scripts/Kconfig b/scripts/Kconfig
>>> index 9b744deba9..747f665e02 100644
>>> --- a/scripts/Kconfig
>>> +++ b/scripts/Kconfig
>>> @@ -110,6 +110,11 @@ config RK_USB_LOADER
>>>  
>>>  	  You need libusb-1.0 to compile this tool.
>>>  
>>> +config QOICONV
>>> +	bool "QOI image format conversion" if COMPILE_HOST_TOOLS
>>> +	help
>>> +	  This enable converting png to qoi images to generate boot logo.
>>> +
>>>  endmenu
>>>  
>>>  menu "Target Tools"
>>> diff --git a/scripts/Makefile b/scripts/Makefile
>>> index dc5fa75f90..cbaf2d55ff 100644
>>> --- a/scripts/Makefile
>>> +++ b/scripts/Makefile
>>> @@ -8,6 +8,7 @@ hostprogs-always-y					+= fix_size
>>>  hostprogs-always-y					+= bareboxenv
>>>  hostprogs-always-y					+= bareboxcrc32
>>>  hostprogs-always-y					+= kernel-install
>>> +hostprogs-always-$(CONFIG_QOICONV)			+= qoiconv
>>>  hostprogs-always-$(CONFIG_CRYPTO_RSA_BUILTIN_KEYS)	+= rsatoc
>>>  HOSTCFLAGS_rsatoc = `pkg-config --cflags openssl`
>>>  HOSTLDLIBS_rsatoc = `pkg-config --libs openssl`
>>> diff --git a/scripts/qoiconv.c b/scripts/qoiconv.c
>>> new file mode 100644
>>> index 0000000000..010c70ead0
>>> --- /dev/null
>>> +++ b/scripts/qoiconv.c
>>> @@ -0,0 +1,91 @@
> Probably missing SPDX identifiers as well
> 
>>> +/*
>>> +
>>> +Command line tool to convert between png <> qoi format
>>> +
>>> +Requires "stb_image.h" and "stb_image_write.h"
>>> +Compile with: 
>>> +	gcc qoiconv.c -std=c99 -O3 -o qoiconv
>>> +
>>> +Dominic Szablewski - https://phoboslab.org
>>> +
>>> +
>>> +-- LICENSE: The MIT License(MIT)
>>> +
>>> +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.
>>> +
>>> +*/
>>
>> Can you not reuse the header added in the previous commit?
> I am not sure what you mean here, the qoi.h header is reused from
> lib/gui/qoi.h, see the include below.
> Are you sugesting to _not_ reuse the header?

All good then. I missed that.

> 
> 
>>> +
>>> +
>>> +#define STB_IMAGE_IMPLEMENTATION
>>> +#define STBI_ONLY_PNG
>>> +#define STBI_NO_LINEAR
>>> +#include "stb_image.h"
>>> +
>>> +#define QOI_IMPLEMENTATION
>>> +#include "../lib/gui/qoi.h"
> included here.
> 
> 
> 
> 
> 
> 
> 


-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

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


  reply	other threads:[~2022-01-17 11:49 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 ` [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
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 [this message]
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=cbfacecf-06b8-81d1-50cc-7398fd003903@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=jmaselbas@kalray.eu \
    /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