From 8af029ac92e581c584657294665a7ea70fa2c536 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Jastrz=C4=99bski?= Date: Tue, 14 Jul 2015 17:40:33 +0200 Subject: [PATCH 1/3] Fixed MOBI header (close #149) --- kcc/comic2ebook.py | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/kcc/comic2ebook.py b/kcc/comic2ebook.py index d8be58ff..123ab499 100755 --- a/kcc/comic2ebook.py +++ b/kcc/comic2ebook.py @@ -313,18 +313,15 @@ def buildOPF(dstdir, title, filelist, cover=None): "portrait\n", "pre-paginated\n"]) if options.iskindle and options.profile != 'Custom': - f.writelines(["true\n", - "true\n", - "comic\n", - "true\n", - "true\n", - "true\n", - "portrait\n", - "", - str(deviceres[0]) + "x" + str(deviceres[1]) + "\n", - "" + writingmode + "\n", - "#ffffff\n", - "0\n"]) + f.writelines(["\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n"]) f.writelines(["\n\n\n", " Date: Tue, 14 Jul 2015 17:58:59 +0200 Subject: [PATCH 2/3] Escape HTML in metadata (close #148) --- kcc/comic2ebook.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/kcc/comic2ebook.py b/kcc/comic2ebook.py index 123ab499..06a1c617 100755 --- a/kcc/comic2ebook.py +++ b/kcc/comic2ebook.py @@ -38,6 +38,7 @@ from subprocess import STDOUT, PIPE from psutil import Popen, virtual_memory from scandir import walk +from html import escape try: from PyQt5 import QtCore except ImportError: @@ -743,7 +744,7 @@ def getComicInfo(path, originalPath): options.authors = [] if defaultTitle: if xml.data['Series']: - options.title = xml.data['Series'] + options.title = escape(xml.data['Series']) if xml.data['Volume']: titleSuffix += ' V' + xml.data['Volume'] if xml.data['Number']: @@ -751,7 +752,7 @@ def getComicInfo(path, originalPath): options.title += titleSuffix for field in ['Writers', 'Pencillers', 'Inkers', 'Colorists']: for person in xml.data[field]: - options.authors.append(person) + options.authors.append(escape(person)) if len(options.authors) > 0: options.authors = list(set(options.authors)) options.authors.sort() @@ -762,7 +763,7 @@ def getComicInfo(path, originalPath): if xml.data['Bookmarks']: options.chapters = xml.data['Bookmarks'] if xml.data['Summary']: - options.summary = xml.data['Summary'] + options.summary = escape(xml.data['Summary']) os.remove(xmlPath) From 677622c1037476079d66899c1e959cdbb1247809 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Jastrz=C4=99bski?= Date: Tue, 14 Jul 2015 18:01:02 +0200 Subject: [PATCH 3/3] Updated README + version bump --- README.md | 4 ++++ kcc.iss | 2 +- kcc/__init__.py | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 971a9e04..696c5534 100644 --- a/README.md +++ b/README.md @@ -156,6 +156,10 @@ The app relies and includes the following scripts: * [Kobo Aura H2O](http://kcc.iosphe.re/Samples/Ubunchu-KoAH2O.kepub.epub) ## CHANGELOG +####4.6.2: +* Fixed critical MOBI header bug +* Fixed metadata encoding error + ####4.6.1: * Fixed KEPUB TOC generator * Added warning about too small input files diff --git a/kcc.iss b/kcc.iss index 10a26c89..5deb3435 100644 --- a/kcc.iss +++ b/kcc.iss @@ -1,5 +1,5 @@ #define MyAppName "Kindle Comic Converter" -#define MyAppVersion "4.6.1" +#define MyAppVersion "4.6.2" #define MyAppPublisher "Ciro Mattia Gonano, Paweł Jastrzębski" #define MyAppURL "http://kcc.iosphe.re/" #define MyAppExeName "KCC.exe" diff --git a/kcc/__init__.py b/kcc/__init__.py index 6a54f0ce..10c7f427 100644 --- a/kcc/__init__.py +++ b/kcc/__init__.py @@ -1,4 +1,4 @@ -__version__ = '4.6.1' +__version__ = '4.6.2' __license__ = 'ISC' __copyright__ = '2012-2015, Ciro Mattia Gonano , Pawel Jastrzebski ' __docformat__ = 'restructuredtext en'