diff options
-rw-r--r-- | image-converter/caja-image-resizer.c | 7 | ||||
-rw-r--r-- | image-converter/caja-image-rotator.c | 7 |
2 files changed, 10 insertions, 4 deletions
diff --git a/image-converter/caja-image-resizer.c b/image-converter/caja-image-resizer.c index 02484c1..f9ce576 100644 --- a/image-converter/caja-image-resizer.c +++ b/image-converter/caja-image-resizer.c @@ -258,7 +258,7 @@ run_op (CajaImageResizer *resizer) /* FIXME: check whether new_uri already exists and provide "Replace _All", "_Skip", and "_Replace" options */ gchar *argv[6]; - argv[0] = "/usr/bin/convert"; + argv[0] = "convert"; argv[1] = filename; argv[2] = "-resize"; argv[3] = resizer->size; @@ -267,8 +267,11 @@ run_op (CajaImageResizer *resizer) pid_t pid; - if (!g_spawn_async (NULL, argv, NULL, G_SPAWN_DO_NOT_REAP_CHILD, NULL, NULL, &pid, NULL)) { + if (filename == NULL || new_filename == NULL || + !g_spawn_async (NULL, argv, NULL, G_SPAWN_SEARCH_PATH | G_SPAWN_DO_NOT_REAP_CHILD, NULL, NULL, &pid, NULL)) { // FIXME: error handling + g_free (filename); + g_free (new_filename); return; } diff --git a/image-converter/caja-image-rotator.c b/image-converter/caja-image-rotator.c index a46901b..256fb76 100644 --- a/image-converter/caja-image-rotator.c +++ b/image-converter/caja-image-rotator.c @@ -254,7 +254,7 @@ run_op (CajaImageRotator *rotator) /* FIXME: check whether new_uri already exists and provide "Replace _All", "_Skip", and "_Replace" options */ gchar *argv[8]; - argv[0] = "/usr/bin/convert"; + argv[0] = "convert"; argv[1] = filename; argv[2] = "-rotate"; argv[3] = rotator->angle; @@ -265,8 +265,11 @@ run_op (CajaImageRotator *rotator) pid_t pid; - if (!g_spawn_async (NULL, argv, NULL, G_SPAWN_DO_NOT_REAP_CHILD, NULL, NULL, &pid, NULL)) { + if (filename == NULL || new_filename == NULL || + !g_spawn_async (NULL, argv, NULL, G_SPAWN_DO_NOT_REAP_CHILD | G_SPAWN_SEARCH_PATH, NULL, NULL, &pid, NULL)) { // FIXME: error handling + g_free (filename); + g_free (new_filename); return; } |