about summary refs log tree commit diff
path: root/kindlecomicconverter
diff options
context:
space:
mode:
authorPaweł Jastrzębski <pawelj@iosphe.re>2019-10-21 17:27:38 +0200
committerGitHub <noreply@github.com>2019-10-21 17:27:38 +0200
commit515b83637fd0e531b1b21cac39a7fa42ed0a3f27 (patch)
treed043ef19bd911fa7e02fddb6e341af5f68d95d65 /kindlecomicconverter
parentFixed Windows autoupdater (diff)
parentUpdate build scripts (diff)
downloadkcc-515b83637fd0e531b1b21cac39a7fa42ed0a3f27.tar.gz
kcc-515b83637fd0e531b1b21cac39a7fa42ed0a3f27.tar.bz2
kcc-515b83637fd0e531b1b21cac39a7fa42ed0a3f27.zip
Merge pull request #326 from ciromattia/dev
5.5.2
Diffstat (limited to 'kindlecomicconverter')
-rw-r--r--kindlecomicconverter/KCC_gui.py9
-rw-r--r--kindlecomicconverter/__init__.py2
-rw-r--r--kindlecomicconverter/dualmetafix.py8
-rwxr-xr-xkindlecomicconverter/image.py4
-rw-r--r--kindlecomicconverter/shared.py2
5 files changed, 11 insertions, 14 deletions
diff --git a/kindlecomicconverter/KCC_gui.py b/kindlecomicconverter/KCC_gui.py
index 7690d80..50e91dd 100644
--- a/kindlecomicconverter/KCC_gui.py
+++ b/kindlecomicconverter/KCC_gui.py
@@ -857,7 +857,8 @@ class KCCGUI(KCC_ui.Ui_mainWindow):
                 if sys.platform.startswith('win'):
                     self.addMessage('Download it and place EXE in KCC directory.', 'error')
                 elif sys.platform.startswith('darwin'):
-                    self.addMessage('Install it using <a href="http://brew.sh/">Brew</a>.', 'error')
+                    self.addMessage('Install it using <a href="http://brew.sh/">Brew</a>: <i>brew cask install kindle-c'
+                                    'omic-creator</i>', 'error')
                 else:
                     self.addMessage('Download it and place executable in /usr/local/bin directory.', 'error')
 
@@ -909,8 +910,8 @@ class KCCGUI(KCC_ui.Ui_mainWindow):
                 MW.resize(500, 500)
 
         self.profiles = {
-            "Kindle Oasis 2": {'PVOptions': True, 'ForceExpert': False, 'DefaultFormat': 0,
-                               'DefaultUpscale': True, 'Label': 'KO'},
+            "Kindle Oasis 2/3": {'PVOptions': True, 'ForceExpert': False, 'DefaultFormat': 0,
+                                 'DefaultUpscale': True, 'Label': 'KO'},
             "Kindle Oasis": {'PVOptions': True, 'ForceExpert': False, 'DefaultFormat': 0,
                              'DefaultUpscale': True, 'Label': 'KV'},
             "Kindle Voyage": {'PVOptions': True, 'ForceExpert': False, 'DefaultFormat': 0,
@@ -951,7 +952,7 @@ class KCCGUI(KCC_ui.Ui_mainWindow):
                              'DefaultUpscale': False, 'Label': 'K34'},
         }
         profilesGUI = [
-            "Kindle Oasis 2",
+            "Kindle Oasis 2/3",
             "Kindle Oasis",
             "Kindle Voyage",
             "Kindle PW 3/4",
diff --git a/kindlecomicconverter/__init__.py b/kindlecomicconverter/__init__.py
index c0f1b84..6ad0c10 100644
--- a/kindlecomicconverter/__init__.py
+++ b/kindlecomicconverter/__init__.py
@@ -1,4 +1,4 @@
-__version__ = '5.5.1'
+__version__ = '5.5.2'
 __license__ = 'ISC'
 __copyright__ = '2012-2019, Ciro Mattia Gonano <ciromattia@gmail.com>, Pawel Jastrzebski <pawelj@iosphe.re>'
 __docformat__ = 'restructuredtext en'
diff --git a/kindlecomicconverter/dualmetafix.py b/kindlecomicconverter/dualmetafix.py
index c05dc85..7426f93 100644
--- a/kindlecomicconverter/dualmetafix.py
+++ b/kindlecomicconverter/dualmetafix.py
@@ -143,14 +143,12 @@ class DualMobiMetaFix:
         self.datain_rec0 = readsection(self.datain, 0)
 
         # in the first mobi header
-        # add 501 to "EBOK", add 113 as asin, add 504 as asin
+        # add 501 to "EBOK", add 113 as asin
         rec0 = self.datain_rec0
         rec0 = del_exth(rec0, 501)
         rec0 = del_exth(rec0, 113)
-        rec0 = del_exth(rec0, 504)
         rec0 = add_exth(rec0, 501, b'EBOK')
         rec0 = add_exth(rec0, 113, asin)
-        rec0 = add_exth(rec0, 504, asin)
         replacesection(self.datain, 0, rec0)
 
         ver = getint(self.datain_rec0, mobi_version)
@@ -172,14 +170,12 @@ class DualMobiMetaFix:
         self.datain_kfrec0 = readsection(self.datain, datain_kf8)
 
         # in the second header
-        # add 501 to "EBOK", add 113 as asin, add 504 as asin
+        # add 501 to "EBOK", add 113 as asin
         rec0 = self.datain_kfrec0
         rec0 = del_exth(rec0, 501)
         rec0 = del_exth(rec0, 113)
-        rec0 = del_exth(rec0, 504)
         rec0 = add_exth(rec0, 501, b'EBOK')
         rec0 = add_exth(rec0, 113, asin)
-        rec0 = add_exth(rec0, 504, asin)
         replacesection(self.datain, datain_kf8, rec0)
 
         self.datain.flush()
diff --git a/kindlecomicconverter/image.py b/kindlecomicconverter/image.py
index 118ef3c..35fcfc8 100755
--- a/kindlecomicconverter/image.py
+++ b/kindlecomicconverter/image.py
@@ -83,7 +83,7 @@ class ProfileData:
         'KDX': ("Kindle DX/DXG", (824, 1000), Palette16, 1.8),
         'KPW': ("Kindle Paperwhite 1/2", (758, 1024), Palette16, 1.8),
         'KV': ("Kindle Paperwhite 3/4/Voyage/Oasis", (1072, 1448), Palette16, 1.8),
-        'KO': ("Kindle Oasis 2", (1264, 1680), Palette16, 1.8),
+        'KO': ("Kindle Oasis 2/3", (1264, 1680), Palette16, 1.8),
         'KoMT': ("Kobo Mini/Touch", (600, 800), Palette16, 1.8),
         'KoG': ("Kobo Glo", (768, 1024), Palette16, 1.8),
         'KoGHD': ("Kobo Glo HD", (1072, 1448), Palette16, 1.8),
@@ -358,7 +358,7 @@ class Cover:
         try:
             self.image.save(self.target, "JPEG", optimize=1, quality=85)
         except IOError:
-            raise RuntimeError('Failed to process downloaded cover.')
+            raise RuntimeError('Failed to save cover.')
 
     def saveToKindle(self, kindle, asin):
         self.image = self.image.resize((300, 470), Image.ANTIALIAS)
diff --git a/kindlecomicconverter/shared.py b/kindlecomicconverter/shared.py
index d2a358f..507873b 100644
--- a/kindlecomicconverter/shared.py
+++ b/kindlecomicconverter/shared.py
@@ -47,7 +47,7 @@ class HTMLStripper(HTMLParser):
 def getImageFileName(imgfile):
     name, ext = os.path.splitext(imgfile)
     ext = ext.lower()
-    if name.startswith('.') or ext not in ['.png', '.jpg', '.jpeg', '.gif', '.webp']:
+    if (name.startswith('.') and len(name) == 1) or ext not in ['.png', '.jpg', '.jpeg', '.gif', '.webp']:
         return None
     return [name, ext]