[gegl] pdf-load: use gio to transform path to uri
- From: Øyvind "pippin" Kolås <ok src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gegl] pdf-load: use gio to transform path to uri
- Date: Thu, 21 Feb 2019 12:39:07 +0000 (UTC)
commit 75508ef5ea0454d1db570d2ffe9116da97c01343
Author: Øyvind Kolås <pippin gimp org>
Date: Thu Feb 21 13:39:49 2019 +0100
pdf-load: use gio to transform path to uri
operations/external/pdf-load.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
---
diff --git a/operations/external/pdf-load.c b/operations/external/pdf-load.c
index 1caf38328..f723eb6c8 100644
--- a/operations/external/pdf-load.c
+++ b/operations/external/pdf-load.c
@@ -111,9 +111,11 @@ prepare (GeglOperation *operation)
}
else
{
- char *uri = g_strdup_printf ("file://%s", p->path); // XXX :use better API
+ GFile *file = g_file_new_for_path (p->path);
+ char *uri = g_file_get_uri (file);
p->document = poppler_document_new_from_file (uri, password, NULL);
g_free (uri);
+ g_object_unref (file);
}
p->page = NULL;
p->page_no = -1;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]