image-surface-get-data truncates data
jbromley opened this issue · comments
image-surface-get-data only returns 3/4 of the data for RGB24 format images.
To reproduce:
- Load or create an RGB24 image as an image surface. (I loaded a PNG with image-surface-create-from-png, but the problem is more general.)
- Call image-surface-get-data.
I expect to get all of the data (width * height * 32 bits per pixel), however I only get 3/4 of this. The problem is that get-bytes-per-pixel incorrectly returns 3 for RGB24 format images. According to the Cairo docs, RGB24 images are 32 bits per pixel (see http://www.cairographics.org/manual/cairo-Image-Surfaces.html#cairo-format-t).
I have issued a pull request with a fix.
Should be fixed with your patch. thanks,