|
|
0ff004 |
diff -urNp a/operations/common/magick-load.c b/operations/common/magick-load.c
|
|
|
0ff004 |
--- a/operations/common/magick-load.c 2022-01-11 10:45:06.197914681 +0100
|
|
|
0ff004 |
+++ b/operations/common/magick-load.c 2022-01-11 12:20:00.106477933 +0100
|
|
|
0ff004 |
@@ -39,26 +39,28 @@ load_cache (GeglChantO *op_magick_load)
|
|
|
0ff004 |
if (!op_magick_load->chant_data)
|
|
|
0ff004 |
{
|
|
|
0ff004 |
gchar *filename;
|
|
|
0ff004 |
- gchar *cmd;
|
|
|
0ff004 |
GeglNode *graph, *sink;
|
|
|
0ff004 |
GeglBuffer *newbuf = NULL;
|
|
|
0ff004 |
|
|
|
0ff004 |
/* ImageMagick backed fallback FIXME: make this robust.
|
|
|
0ff004 |
* maybe use pipes in a manner similar to the raw loader,
|
|
|
0ff004 |
* or at least use a properly unique filename */
|
|
|
0ff004 |
-
|
|
|
0ff004 |
+ char *argv[4] = {"convert", NULL, NULL, NULL};
|
|
|
0ff004 |
+
|
|
|
0ff004 |
filename = g_build_filename (g_get_tmp_dir (), "gegl-magick.png", NULL);
|
|
|
0ff004 |
- cmd = g_strdup_printf ("convert \"%s\"'[0]' \"%s\"",
|
|
|
0ff004 |
- op_magick_load->path, filename);
|
|
|
0ff004 |
- if (system (cmd) == -1)
|
|
|
0ff004 |
+ argv[1] = g_strdup_printf ("%s[0]", op_magick_load->path);
|
|
|
0ff004 |
+ argv[2] = filename;
|
|
|
0ff004 |
+ if (!g_spawn_sync (NULL, argv, NULL, G_SPAWN_DEFAULT,
|
|
|
0ff004 |
+ NULL, NULL, NULL, NULL, NULL, NULL))
|
|
|
0ff004 |
g_warning ("Error executing ImageMagick convert program");
|
|
|
0ff004 |
|
|
|
0ff004 |
+ g_free (argv[1]);
|
|
|
0ff004 |
+
|
|
|
0ff004 |
graph = gegl_graph (sink=gegl_node ("gegl:buffer-sink", "buffer", &newbuf, NULL,
|
|
|
0ff004 |
gegl_node ("gegl:png-load", "path", filename, NULL)));
|
|
|
0ff004 |
gegl_node_process (sink);
|
|
|
0ff004 |
op_magick_load->chant_data = (gpointer) newbuf;
|
|
|
0ff004 |
g_object_unref (graph);
|
|
|
0ff004 |
- g_free (cmd);
|
|
|
0ff004 |
g_free (filename);
|
|
|
0ff004 |
}
|
|
|
0ff004 |
}
|