]> granicus.if.org Git - graphviz/commitdiff
loadimage support for ps:lasi
authorellson <devnull@localhost>
Sat, 20 Sep 2008 01:51:36 +0000 (01:51 +0000)
committerellson <devnull@localhost>
Sat, 20 Sep 2008 01:51:36 +0000 (01:51 +0000)
fux bug in gvloadimage_pango.c where wrong type was being free'd

plugin/core/gvloadimage_core.c
plugin/gd/gvloadimage_gd.c
plugin/pango/gvloadimage_pango.c

index 97b6e25e20b444021d4c2311d5380eef408aa4c7..c37a336bc845d0da5fb8fc321b9a85735bc38442 100644 (file)
@@ -284,6 +284,7 @@ gvplugin_installed_t gvloadimage_core_types[] = {
     {FORMAT_JPEG_VRML, "jpg:vrml", 1, &engine_vrml, NULL},
 
     {FORMAT_PS_PS, "ps:ps", 1, &engine_ps, NULL},
+    {FORMAT_PS_PS, "ps:lasi", 1, &engine_ps, NULL},
     {FORMAT_PSLIB_PS, "(lib):ps", 1, &engine_pslib, NULL},  /* for pslib */
 
     {FORMAT_PNG_DOT, "png:dot", 1, &engine_dot, NULL},
index e51439d97dae22bcab19c82bf2a0f8f0fdc96b53..6ec642fb8077b9b2d16795ab3518992fbcef0bf9 100644 (file)
@@ -212,23 +212,32 @@ gvplugin_installed_t gvloadimage_gd_types[] = {
     {FORMAT_XBM_GD, "xbm:gd", 1, &engine, NULL},
 #endif
     {FORMAT_GD_PS, "gd:ps", 1, &engine_ps, NULL},
+    {FORMAT_GD_PS, "gd:lasi", 1, &engine_ps, NULL},
     {FORMAT_GD2_PS, "gd2:ps", 1, &engine_ps, NULL},
+    {FORMAT_GD2_PS, "gd2:lasi", 1, &engine_ps, NULL},
 #ifdef HAVE_GD_GIF
     {FORMAT_GIF_PS, "gif:ps", 1, &engine_ps, NULL},
+    {FORMAT_GIF_PS, "gif:lasi", 1, &engine_ps, NULL},
 #endif
 #ifdef HAVE_GD_JPEG
     {FORMAT_JPG_PS, "jpeg:ps", 1, &engine_ps, NULL},
     {FORMAT_JPG_PS, "jpg:ps", 1, &engine_ps, NULL},
     {FORMAT_JPG_PS, "jpe:ps", 1, &engine_ps, NULL},
+    {FORMAT_JPG_PS, "jpeg:lasi", 1, &engine_ps, NULL},
+    {FORMAT_JPG_PS, "jpg:lasi", 1, &engine_ps, NULL},
+    {FORMAT_JPG_PS, "jpe:lasi", 1, &engine_ps, NULL},
 #endif
 #ifdef HAVE_GD_PNG
     {FORMAT_PNG_PS, "png:ps", 1, &engine_ps, NULL},
+    {FORMAT_PNG_PS, "png:lasi", 1, &engine_ps, NULL},
 #endif
 #ifdef HAVE_GD_WBMP
     {FORMAT_WBMP_PS, "wbmp:ps", 1, &engine_ps, NULL},
+    {FORMAT_WBMP_PS, "wbmp:lasi", 1, &engine_ps, NULL},
 #endif
 #ifdef HAVE_GD_XPM
     {FORMAT_XBM_PS, "xbm:ps", 1, &engine_ps, NULL},
+    {FORMAT_XBM_PS, "xbm:lasi", 1, &engine_ps, NULL},
 #endif
 #endif
     {0, NULL, 0, NULL, NULL}
index df600afec4c3967822f801fbce1fdb565bb45a0f..9e65ef92ff90173e99a059cdd0a41112d499bec8 100644 (file)
@@ -40,7 +40,7 @@ reader (void *closure, unsigned char *data, unsigned int length)
 
 static void cairo_freeimage(usershape_t *us)
 {
-    cairo_destroy((cairo_t*)us->data);
+    cairo_surface_destroy((cairo_surface_t*)(us->data));
 }
 
 static cairo_surface_t* cairo_loadimage(GVJ_t * job, usershape_t *us)
@@ -56,6 +56,7 @@ static cairo_surface_t* cairo_loadimage(GVJ_t * job, usershape_t *us)
              surface = (cairo_surface_t*)(us->data); /* use cached data */
         else {
              us->datafree(us);        /* free incompatible cache data */
+             us->datafree = NULL;
              us->data = NULL;
         }
     }
@@ -166,6 +167,7 @@ static gvloadimage_engine_t engine_ps = {
 gvplugin_installed_t gvloadimage_pango_types[] = {
 #ifdef HAVE_PANGOCAIRO
     {FORMAT_PNG_CAIRO, "png:cairo", 1, &engine_cairo, NULL},
+    {FORMAT_PNG_PS, "png:lasi", 2, &engine_ps, NULL},
     {FORMAT_PNG_PS, "png:ps", 2, &engine_ps, NULL},
 #endif
     {0, NULL, 0, NULL, NULL}