qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* Patch for png_save(), QEMU v8.0
@ 2023-05-02 13:48 Валентин via
  2023-05-02 13:59 ` Peter Maydell
  0 siblings, 1 reply; 3+ messages in thread
From: Валентин via @ 2023-05-02 13:48 UTC (permalink / raw)
  To: qemu-devel


[-- 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;

^ permalink raw reply	[flat|nested] 3+ messages in thread
[parent not found: <6hqkbi1b7alen721of3thdv8.1683036666264@email.android.com>]

end of thread, other threads:[~2023-05-02 14:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-02 13:48 Patch for png_save(), QEMU v8.0 Валентин via
2023-05-02 13:59 ` Peter Maydell
     [not found] <6hqkbi1b7alen721of3thdv8.1683036666264@email.android.com>
2023-05-02 14:37 ` Валентин

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).