Fix path for the generated picture and improve error message

This commit is contained in:
Martijn Braam
2021-01-11 16:43:48 +01:00
parent 3f8ee6227f
commit d140e44d73
2 changed files with 2 additions and 1 deletions

2
main.c
View File

@@ -337,7 +337,7 @@ on_open_last_clicked(GtkWidget *widget, gpointer user_data)
}
sprintf(uri, "file://%s", last_path);
if (!g_app_info_launch_default_for_uri(uri, NULL, &error)) {
g_printerr("Could not launch image viewer: %s\n", error->message);
g_printerr("Could not launch image viewer for '%s': %s\n", uri, error->message);
}
}

View File

@@ -331,6 +331,7 @@ post_process_finished(GSubprocess *proc, GAsyncResult *res, cairo_surface_t *thu
char *path = path = stdout + end - 1;
do {
if (*path == '\n') {
path++;
break;
}
--path;