rpav / cl-cairo2

Cairo bindings for Common Lisp

Home Page:https://github.com/rpav/cl-cairo2/wiki

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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:

  1. 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.)
  2. 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,