id = 962 title = "Screenshot images are skewed" state = "opened" created_at = "2022-04-04T16:01:30.121Z" closed_at = "n/a" labels = [] url = "https://gitlab.com/qemu-project/qemu/-/issues/962" host-os = "Debian Bullseye" host-arch = "x86_64" qemu-version = "tested with 5.2 and 6.2" guest-os = "Ubuntu 20.04 (and others)" guest-arch = "x86_64" description = """1. Start a guest with SPICE 2. Connect with a SPICE client 3. Resize screen to a width that is not a multiple of 4 (e. g. 487x956) 4. Take a screenshot The screenshot ppm file will contain the actual dimensions in the header, e. g. ``` P6 487 956 255 ``` but the image data will contain more than that (e. g. 488 * 956 * 3 bytes). As a result, when displaying the image it appears skewed.""" reproduce = """See above.""" additional = """I'm not familiar with qemu code nor the pixman library, but I assume that in [this line](https://gitlab.com/qemu-project/qemu/-/blob/bc6ec396d471d9e4aae7e2ff8b72e11da9a97665/ui/console.c#L316) `get_stride` is wrong. Instead, it should write `width*3` bytes."""