[cairo] trouble with large image sizes

Dan Raymond draymond at foxvalley.net
Mon Jan 25 17:44:00 PST 2016


I'm trying to create a large image surface using Cairo but I am getting 
an error.  When I execute the following code it succeeds (status is 
CAIRO_STATUS_SUCCESS):

uint32_t width = 40960, height = 23040;
cairo_surface_t *surface = 
cairo_image_surface_create(CAIRO_FORMAT_RGB24, width, height);
printf("status = %d\n", cairo_surface_status(surface));

But if I double the width and height it fails (status is 
CAIRO_STATUS_INVALID_SIZE):

uint32_t width = 81920, height = 46080;
cairo_surface_t *surface = 
cairo_image_surface_create(CAIRO_FORMAT_RGB24, width, height);
printf("status = %d\n", cairo_surface_status(surface));

Is there an arbitrary restriction on the size of an image surface?


More information about the cairo mailing list