Hi.
In backend_libheif.c, the stride (in bytes) is taken from function heif_image_get_plane_readonly, but it is not used. Sometimes, libheif gives stride greater than the image width, which results in the image looking skewed.
Here is an example of properly using the stride to extract the image:
if (width*4 == stride) { memcpy(bitmap, data, width * height * 4); } else { const uint8_t row_src = data; uint8_t row_dst = bitmap; for (int y = 0; y < height; ++y) { memcpy(row_dst, row_src, width4); row_dst += width4; row_src += stride; } }
Thanks.