]> granicus.if.org Git - graphviz/commitdiff
RGB patch
authorellson <devnull@localhost>
Sun, 4 May 2008 17:13:03 +0000 (17:13 +0000)
committerellson <devnull@localhost>
Sun, 4 May 2008 17:13:03 +0000 (17:13 +0000)
plugin/pango/gvloadimage_pango.c

index 101178dc85063aca5bf554838e459a243f0fab2f..df600afec4c3967822f801fbce1fdb565bb45a0f 100644 (file)
@@ -101,12 +101,17 @@ static void pango_loadimage_cairo(GVJ_t * job, usershape_t *us, boxf b, boolean
 static void pango_loadimage_ps(GVJ_t * job, usershape_t *us, boxf b, boolean filled)
 {
     cairo_surface_t *surface;  /* source surface */
+    cairo_format_t format;
     FILE *out = job->output_file;
     int X, Y, x, y, stride;
     unsigned char *data, *ix, alpha, red, green, blue;
 
     surface = cairo_loadimage(job, us);
-    if (surface && (cairo_image_surface_get_format(surface) == CAIRO_FORMAT_ARGB32)) {
+    if (surface) {
+               format = cairo_image_surface_get_format(surface);
+        if ((format != CAIRO_FORMAT_ARGB32) && (format != CAIRO_FORMAT_RGB24))
+           return;
+
        X = cairo_image_surface_get_width(surface);
        Y = cairo_image_surface_get_height(surface);
        stride = cairo_image_surface_get_stride(surface);