Closed codename68 closed 5 years ago
Thanks for reporting!
Tested with:
let () =
let ba = Bigarray.(Array2.create Int32 C_layout 8 4) in
Bigarray.Array2.fill ba 0l;
ba.{0, 1} <- -1l;
ba.{1, 0} <- 0xFFFF0000l;
ba.{7, 0} <- 0xFF0000FFl;
let surf = Cairo.Image.create_for_data32 ba in
Cairo.PNG.write surf "test.png"
Hi,
the function 'create_for_data32' mixes width and height: the first dimension of the Bigarray.Array2 should be the height and the second the width.
The following code produces a 8 by 4 pixels png file, with transparent pixels everywhere but for the white pixel (4, 0), but I expected it to be at (1, 0).
The following code bypasses the bug: