You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gnome-epub-thumbnailer/0001-epub-Fix-cover-path-fo...

33 lines
1.0 KiB

From 6b8964ee5716ce6abe86d656886f3b389fa4c0cb Mon Sep 17 00:00:00 2001
From: Chris Lee <clee@mg8.org>
Date: Fri, 4 Apr 2014 05:26:20 -0700
Subject: [PATCH 1/2] epub: Fix cover path for root=level OPF files
If the OPF file is in the root dir, g_path_get_dirname returns "."
instead of an empty string. This results in an invalid key for the cover
image, because it looks like "./OEBPS/cover_path.jpg" instead of
"OEBPS/cover_path.jpg" and then unzipping for that path fails.
---
gnome-epub-thumbnailer.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/gnome-epub-thumbnailer.c b/gnome-epub-thumbnailer.c
index b3e45e3..07aacc3 100644
--- a/gnome-epub-thumbnailer.c
+++ b/gnome-epub-thumbnailer.c
@@ -196,7 +196,10 @@ resolve_cover_path (const char *cover_path,
char *ret;
dirname = g_path_get_dirname (root_path);
- ret = g_build_filename (dirname, cover_path, NULL);
+ if (g_strcmp0(".", dirname) != 0)
+ ret = g_build_filename (dirname, cover_path, NULL);
+ else
+ ret = g_strdup(cover_path);
g_free (dirname);
return ret;
--
2.0.4