All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Валентин via" <qemu-devel@nongnu.org>
To: qemu-devel@nongnu.org
Subject: Patch for png_save(), QEMU v8.0
Date: Tue, 02 May 2023 16:48:00 +0300	[thread overview]
Message-ID: <E1ptqMT-00HAI8-NC.val15032008-mail-ru@smtp44.i.mail.ru> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 552 bytes --]

Hello!  Currently, png_save() in "console.c" uses "PIXMAN_a8r8g8b8" format when saving png.  ( https://gitlab.com/qemu-project/qemu/-/blob/7c18f2d663521f1b31b821a13358ce38075eaf7d/ui/console.c#L314 )  It should probably use "PIXMAN_a8b8g8r8" (red<>blue exchanged). Without it I'm getting PNGs with blue and red channels swapped (QEMU 8.0, qemu-system-x86_64, Arm64 host, libpng 1.6.39).  Steps to reproduce: in QEMU 8.0 console execute "screendump /path/to/screenshot.png -f png".  The patch is in attachment. With best regards, Valentine.

[-- Attachment #1.2: Type: text/html, Size: 1013 bytes --]

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 800_abgr.patch --]
[-- Type: text/x-diff; name="800_abgr.patch", Size: 576 bytes --]

diff -ru --no-dereference /tmp/qemu-8.0.0/ui/console.c ./ui/console.c
--- /tmp/qemu-8.0.0/ui/console.c	2023-04-19 16:31:47.000000000 +0000
+++ ./ui/console.c	2023-05-02 12:59:02.600469950 +0000
@@ -311,7 +311,7 @@
     png_struct *png_ptr;
     png_info *info_ptr;
     g_autoptr(pixman_image_t) linebuf =
-                            qemu_pixman_linebuf_create(PIXMAN_a8r8g8b8, width);
+                            qemu_pixman_linebuf_create(PIXMAN_a8b8g8r8, width);
     uint8_t *buf = (uint8_t *)pixman_image_get_data(linebuf);
     FILE *f = fdopen(fd, "wb");
     int y;

             reply	other threads:[~2023-05-02 13:48 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-02 13:48 Валентин via [this message]
2023-05-02 13:59 ` Patch for png_save(), QEMU v8.0 Peter Maydell
     [not found] <6hqkbi1b7alen721of3thdv8.1683036666264@email.android.com>
2023-05-02 14:37 ` Валентин

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=E1ptqMT-00HAI8-NC.val15032008-mail-ru@smtp44.i.mail.ru \
    --to=qemu-devel@nongnu.org \
    --cc=val15032008@mail.ru \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.