Black avatar images
Fractal shows black avatars for some rooms
Steps to reproduce
- Open Fractal
Information
-
This bug is reproducible from the latest nightly build - Fractal 6:
- Arch Linux:
- Arch 'extra' repo and compiled from sourc:
In console it prints
(fractal:113714): Gdk-CRITICAL **: 15:55:25.776: gdk_memory_texture_new: assertion 'stride >= width * gdk_memory_format_bytes_per_pixel (format)' failed
which come from building gdk::MemoryTexture
in function texture_from_data()
in src/components/image_printable.rs
.
Looks like it happens when image is not 3 bytes per pixel (eg gdk::MemoryFormat::R16g16b16
).
For a 480x480px R16g16b16
image , layout
param is
SampleLayout { channels: 3, channel_stride: 1, width: 480, width_stride: 3, height: 480, height_stride: 1440 }
height_stride
is passed as stride
param.
R16g16b16
is 6 bytes per pixes, times 480px, stride should be 2880, but height_stride
here is 1440, so assert triggers.
layout comes from image crate where height_stride is calculated as n_of_channels * width
but gdk::MemoryTexture
expects bytes_per_pixes * width
I was thinking it was a bug in image crate, but docs for SampleLayout talks about 'index to get next sample', so it works when every channel is one byte