From eef3ff434b25e532d19565a1bec984d812487ab0 Mon Sep 17 00:00:00 2001
From: Ciro Mattia Gonano
Date: Wed, 4 Dec 2013 11:08:04 +0100
Subject: [PATCH 01/17] Added BountySource link and reformatted Donations
section
---
README.md | 15 +++++++--------
1 file changed, 7 insertions(+), 8 deletions(-)
diff --git a/README.md b/README.md
index 25346143..a3438361 100644
--- a/README.md
+++ b/README.md
@@ -10,15 +10,14 @@ It can also optionally optimize images by applying a number of transformations.
Amazon's tool is for comic publishers and involves a lot of manual effort, while **KCC** is for comic readers.
_KC2_ in no way is a replacement for **KCC** so you can be quite confident we'll going to carry on developing our little monster ;-)
-### Donations
-If you find **KCC** valuable you can consider donating to the authors:
+### Issues / new features / donations
+If you have some problems using KCC please [file an issue here](https://github.com/ciromattia/kcc/issues/new).
+If you can fix an open issue, fork & make a pull request.
+If you want more chances an issue is fixes or your wanted feature added, consider [placing a bounty](https://www.bountysource.com/trackers/65571-ciromattia-kcc)!
-* Ciro Mattia Gonano
- * PayPal: [](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=D8WNYNPBGDAS2)
- * Flattr: [](http://flattr.com/thing/2260449/ciromattiakcc-on-GitHub)
-* Paweł Jastrzębski
- * PayPal: [](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YTTJ4LK2JDHPS)
- * BitCoin: [1W15wwqsfd7wbaZ6wvSJf1LW1bz6q5L8b](bitcoin:1W15wwqsfd7wbaZ6wvSJf1LW1bz6q5L8b?label=KCC)
+If you find **KCC** valuable you can consider donating to the authors:
+ * Ciro Mattia Gonano: [](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=D8WNYNPBGDAS2) [](http://flattr.com/thing/2260449/ciromattiakcc-on-GitHub)
+ * Paweł Jastrzębski: [](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YTTJ4LK2JDHPS) [](bitcoin:1W15wwqsfd7wbaZ6wvSJf1LW1bz6q5L8b?label=KCC)
## BINARY RELEASES
You can find the latest released binary at the following links:
From 7facf2d62003294a7ad238382b11f0e670b11535 Mon Sep 17 00:00:00 2001
From: Ciro Mattia Gonano
Date: Wed, 4 Dec 2013 11:42:26 +0100
Subject: [PATCH 02/17] Re-add text link for bitcoin
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index a3438361..9364a25a 100644
--- a/README.md
+++ b/README.md
@@ -17,7 +17,7 @@ If you want more chances an issue is fixes or your wanted feature added, conside
If you find **KCC** valuable you can consider donating to the authors:
* Ciro Mattia Gonano: [](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=D8WNYNPBGDAS2) [](http://flattr.com/thing/2260449/ciromattiakcc-on-GitHub)
- * Paweł Jastrzębski: [](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YTTJ4LK2JDHPS) [](bitcoin:1W15wwqsfd7wbaZ6wvSJf1LW1bz6q5L8b?label=KCC)
+ * Paweł Jastrzębski: [](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YTTJ4LK2JDHPS) [](bitcoin:1W15wwqsfd7wbaZ6wvSJf1LW1bz6q5L8b?label=KCC) [1W15wwqsfd7wbaZ6wvSJf1LW1bz6q5L8b?label=KCC](bitcoin:1W15wwqsfd7wbaZ6wvSJf1LW1bz6q5L8b?label=KCC)
## BINARY RELEASES
You can find the latest released binary at the following links:
From af263073b5adfbf9236beaf3b91ff78e0d727ac1 Mon Sep 17 00:00:00 2001
From: Ciro Mattia Gonano
Date: Wed, 4 Dec 2013 11:42:45 +0100
Subject: [PATCH 03/17] Update README.md
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 9364a25a..196b8478 100644
--- a/README.md
+++ b/README.md
@@ -17,7 +17,7 @@ If you want more chances an issue is fixes or your wanted feature added, conside
If you find **KCC** valuable you can consider donating to the authors:
* Ciro Mattia Gonano: [](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=D8WNYNPBGDAS2) [](http://flattr.com/thing/2260449/ciromattiakcc-on-GitHub)
- * Paweł Jastrzębski: [](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YTTJ4LK2JDHPS) [](bitcoin:1W15wwqsfd7wbaZ6wvSJf1LW1bz6q5L8b?label=KCC) [1W15wwqsfd7wbaZ6wvSJf1LW1bz6q5L8b?label=KCC](bitcoin:1W15wwqsfd7wbaZ6wvSJf1LW1bz6q5L8b?label=KCC)
+ * Paweł Jastrzębski: [](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YTTJ4LK2JDHPS) [](bitcoin:1W15wwqsfd7wbaZ6wvSJf1LW1bz6q5L8b?label=KCC) [1W15wwqsfd7wbaZ6wvSJf1LW1bz6q5L8b](bitcoin:1W15wwqsfd7wbaZ6wvSJf1LW1bz6q5L8b?label=KCC)
## BINARY RELEASES
You can find the latest released binary at the following links:
From 572e1422bf08bc0b580548c86cfdf7fbac81d070 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Pawe=C5=82=20Jastrz=C4=99bski?=
Date: Wed, 4 Dec 2013 18:30:19 +0100
Subject: [PATCH 04/17] Gamma auto mode is now even more automatic
---
KCC-Linux.ui | 6 ------
KCC-OSX.ui | 6 ------
KCC.ui | 6 ------
README.md | 1 -
kcc/KCC_gui.py | 2 +-
kcc/KCC_ui.py | 4 +---
kcc/KCC_ui_linux.py | 4 +---
kcc/KCC_ui_osx.py | 4 +---
kcc/image.py | 29 ++++++++++++++++++++++++++++-
9 files changed, 32 insertions(+), 30 deletions(-)
diff --git a/KCC-Linux.ui b/KCC-Linux.ui
index 80340191..9ce02215 100644
--- a/KCC-Linux.ui
+++ b/KCC-Linux.ui
@@ -543,9 +543,6 @@ p, li { white-space: pre-wrap; }
DejaVu Sans
-
- <html><head/><body><p>When converting color images setting this option to 1.0 <span style=" font-weight:600;">might</span> improve readability.</p></body></html>
-
Gamma: Auto
@@ -567,9 +564,6 @@ p, li { white-space: pre-wrap; }
Qt::ClickFocus
-
- <html><head/><body><p>When converting color images setting this option to 1.0 <span style=" font-weight:600;">might</span> improve readability.</p></body></html>
-
500
diff --git a/KCC-OSX.ui b/KCC-OSX.ui
index 1c7c5ae1..775ab4a2 100644
--- a/KCC-OSX.ui
+++ b/KCC-OSX.ui
@@ -543,9 +543,6 @@
false
-
- <html><head/><body><p><span style=" font-size:12pt;">When converting color images setting this option to 1.0 </span><span style=" font-size:12pt; font-weight:600;">might</span><span style=" font-size:12pt;"> improve readability.</span></p></body></html>
-
Gamma: Auto
@@ -567,9 +564,6 @@
Qt::ClickFocus
-
- <html><head/><body><p><span style=" font-size:12pt;">When converting color images setting this option to 1.0 </span><span style=" font-size:12pt; font-weight:600;">might</span><span style=" font-size:12pt;"> improve readability.</span></p></body></html>
-
500
diff --git a/KCC.ui b/KCC.ui
index edb433a3..bd093790 100644
--- a/KCC.ui
+++ b/KCC.ui
@@ -469,9 +469,6 @@ p, li { white-space: pre-wrap; }
40
-
- When converting color images setting this option to 1.0 MIGHT improve readability.
-
Gamma: Auto
@@ -488,9 +485,6 @@ p, li { white-space: pre-wrap; }
Qt::ClickFocus
-
- <html><head/><body><p>When converting color images setting this option to 1.0 <span style=" font-weight:600;">might</span> improve readability.</p></body></html>
-
500
diff --git a/README.md b/README.md
index 196b8478..27b8ee08 100644
--- a/README.md
+++ b/README.md
@@ -54,7 +54,6 @@ You can find the latest released binary at the following links:
* Read tooltip of _High/Ultra quality_ option. There are many important informations there.
* When converting images smaller than device resolution remember to enable upscaling.
* Panel View (auto zooming every part of page) can be disabled directly on Kindle. There is no KCC option to do that.
-* If you're converting color images and the end result is not satisfactory, experiment with gamma correction option (check 1.0 setting first).
* Check our [wiki](https://github.com/ciromattia/kcc/wiki/Other-devices) for a list of tested Non-Kindle E-Readers.
* The first image found will be set as the comic's cover.
* All files/directories will be added to EPUB in alphabetical order.
diff --git a/kcc/KCC_gui.py b/kcc/KCC_gui.py
index 3713f654..1420f162 100644
--- a/kcc/KCC_gui.py
+++ b/kcc/KCC_gui.py
@@ -372,6 +372,7 @@ class WorkerThread(QtCore.QThread):
if GUI.WebtoonBox.isChecked():
argv.append("--webtoon")
if float(GUI.GammaValue) > 0.09:
+ # noinspection PyTypeChecker
argv.append("--gamma=" + GUI.GammaValue)
if str(GUI.FormatBox.currentText()) == 'CBZ':
argv.append("--cbz-output")
@@ -715,7 +716,6 @@ class KCCGUI(KCC_ui.Ui_KCC):
GUI.QualityBox.setChecked(False)
GUI.MangaBox.setEnabled(False)
GUI.MangaBox.setChecked(False)
- self.addMessage('If images will be too dark after conversion: Set Gamma to 1.0.', 'info')
else:
if not GUI.ProcessingBox.isChecked():
GUI.NoRotateBox.setEnabled(True)
diff --git a/kcc/KCC_ui.py b/kcc/KCC_ui.py
index a491c899..60e4672e 100644
--- a/kcc/KCC_ui.py
+++ b/kcc/KCC_ui.py
@@ -2,7 +2,7 @@
# Form implementation generated from reading ui file 'KCC.ui'
#
-# Created: Tue Nov 12 14:31:48 2013
+# Created: Wed Dec 04 18:28:13 2013
# by: PyQt4 UI code generator 4.10.3
#
# WARNING! All changes made in this file will be lost!
@@ -305,9 +305,7 @@ class Ui_KCC(object):
self.RotateBox.setText(_translate("KCC", "Horizontal mode", None))
self.BasicModeButton.setText(_translate("KCC", "Basic", None))
self.AdvModeButton.setText(_translate("KCC", "Advanced", None))
- self.GammaLabel.setToolTip(_translate("KCC", "When converting color images setting this option to 1.0 MIGHT improve readability.", None))
self.GammaLabel.setText(_translate("KCC", "Gamma: Auto", None))
- self.GammaSlider.setToolTip(_translate("KCC", "When converting color images setting this option to 1.0 might improve readability.
", None))
self.ColorBox.setToolTip(_translate("KCC", "Do not convert images to grayscale.", None))
self.ColorBox.setText(_translate("KCC", "Color mode", None))
self.wLabel.setToolTip(_translate("KCC", "Resolution of target device.", None))
diff --git a/kcc/KCC_ui_linux.py b/kcc/KCC_ui_linux.py
index 9fbdea30..372006a9 100644
--- a/kcc/KCC_ui_linux.py
+++ b/kcc/KCC_ui_linux.py
@@ -2,7 +2,7 @@
# Form implementation generated from reading ui file 'KCC-Linux.ui'
#
-# Created: Tue Nov 12 14:32:11 2013
+# Created: Wed Dec 04 18:27:52 2013
# by: PyQt4 UI code generator 4.10.3
#
# WARNING! All changes made in this file will be lost!
@@ -374,9 +374,7 @@ class Ui_KCC(object):
self.RotateBox.setText(_translate("KCC", "Horizontal mode", None))
self.BasicModeButton.setText(_translate("KCC", "Basic", None))
self.AdvModeButton.setText(_translate("KCC", "Advanced", None))
- self.GammaLabel.setToolTip(_translate("KCC", "When converting color images setting this option to 1.0 might improve readability.
", None))
self.GammaLabel.setText(_translate("KCC", "Gamma: Auto", None))
- self.GammaSlider.setToolTip(_translate("KCC", "When converting color images setting this option to 1.0 might improve readability.
", None))
self.ColorBox.setToolTip(_translate("KCC", "Do not convert images to grayscale.", None))
self.ColorBox.setText(_translate("KCC", "Color mode", None))
self.wLabel.setToolTip(_translate("KCC", "Resolution of target device.", None))
diff --git a/kcc/KCC_ui_osx.py b/kcc/KCC_ui_osx.py
index c0910b88..b8e8d150 100644
--- a/kcc/KCC_ui_osx.py
+++ b/kcc/KCC_ui_osx.py
@@ -2,7 +2,7 @@
# Form implementation generated from reading ui file 'KCC-OSX.ui'
#
-# Created: Tue Nov 12 14:31:59 2013
+# Created: Wed Dec 04 18:28:04 2013
# by: PyQt4 UI code generator 4.10.3
#
# WARNING! All changes made in this file will be lost!
@@ -392,9 +392,7 @@ class Ui_KCC(object):
self.RotateBox.setText(_translate("KCC", "Horizontal mode", None))
self.BasicModeButton.setText(_translate("KCC", "Basic", None))
self.AdvModeButton.setText(_translate("KCC", "Advanced", None))
- self.GammaLabel.setToolTip(_translate("KCC", "
When converting color images setting this option to 1.0 might improve readability.
", None))
self.GammaLabel.setText(_translate("KCC", "Gamma: Auto", None))
- self.GammaSlider.setToolTip(_translate("KCC", "When converting color images setting this option to 1.0 might improve readability.
", None))
self.ColorBox.setToolTip(_translate("KCC", "Do not convert images to grayscale.
", None))
self.ColorBox.setText(_translate("KCC", "Color mode", None))
self.wLabel.setToolTip(_translate("KCC", "Resolution of target device.
", None))
diff --git a/kcc/image.py b/kcc/image.py
index 3c80d745..3e848c38 100755
--- a/kcc/image.py
+++ b/kcc/image.py
@@ -214,6 +214,8 @@ class ComicPage:
def optimizeImage(self, gamma):
if gamma < 0.1:
gamma = self.gamma
+ if self.gamma != 1.0 and self.isImageColor(self.image):
+ gamma = 1.0
if gamma == 1.0:
self.image = ImageOps.autocontrast(self.image)
else:
@@ -519,4 +521,29 @@ class ComicPage:
if fill > 0:
self.fill = 'black'
else:
- self.fill = 'white'
\ No newline at end of file
+ self.fill = 'white'
+
+ def isImageColor(self, image):
+ v = ImageStat.Stat(image).var
+ isMonochromatic = reduce(lambda x, y: x and y < 0.005, v, True)
+ if isMonochromatic:
+ # Monochromatic
+ return False
+ else:
+ if len(v) == 3:
+ maxmin = abs(max(v) - min(v))
+ if maxmin > 1000:
+ # Color
+ return True
+ elif maxmin > 100:
+ # Probably color
+ return True
+ else:
+ # Grayscale
+ return False
+ elif len(v) == 1:
+ # Black and white
+ return False
+ else:
+ # Detection failed
+ return False
From 17ea85c31f36f6b32664be90ff151ec96cc6c8f1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Pawe=C5=82=20Jastrz=C4=99bski?=
Date: Wed, 4 Dec 2013 18:32:32 +0100
Subject: [PATCH 05/17] Overhauled Panel View support
---
kcc/comic2ebook.py | 76 +++++++++++++++++++++++++++-------------------
kcc/image.py | 75 +++++++++++++++------------------------------
2 files changed, 70 insertions(+), 81 deletions(-)
diff --git a/kcc/comic2ebook.py b/kcc/comic2ebook.py
index 3affd839..830fabfa 100755
--- a/kcc/comic2ebook.py
+++ b/kcc/comic2ebook.py
@@ -129,34 +129,47 @@ def buildHTML(path, imgfile):
"}'>\n"])
if options.quality == 2:
imgfilepv = string.split(imgfile, ".")
- imgfilepv[0] = imgfilepv[0].split("_kccx")[0].replace("_kccnh", "").replace("_kccnv", "")
+ imgfilepv[0] = imgfilepv[0].split("_kccxl")[0].replace("_kccnh", "").replace("_kccnv", "")
imgfilepv[0] += "_kcchq"
imgfilepv = string.join(imgfilepv, ".")
else:
imgfilepv = imgfile
- if "_kccx" in filename[0]:
- xy = string.split(filename[0], "_kccx")[1]
- x = string.split(xy, "_kccy")[0].lstrip("0")
- y = string.split(xy, "_kccy")[1].lstrip("0")
- if x != "":
- x = "-" + str(float(x)/100) + "%"
+ if "_kccxl" in filename[0]:
+ borders = filename[0].split('_kccxl')[1]
+ borders = re.findall('[0-9]{1,6}', borders)
+ xl = borders[0].lstrip("0")
+ yu = borders[1].lstrip("0")
+ xr = borders[2].lstrip("0")
+ yd = borders[3].lstrip("0")
+ if xl != "":
+ xl = "-" + str(xl) + "px"
else:
- x = "0%"
- if y != "":
- y = "-" + str(float(y)/100) + "%"
+ xl = "0px"
+ if xr != "":
+ xr = "-" + str(xr) + "px"
else:
- y = "0%"
+ xr = "0px"
+ if yu != "":
+ yu = "-" + str(yu) + "px"
+ else:
+ yu = "0px"
+ if yd != "":
+ yd = "-" + str(yd) + "px"
+ else:
+ yd = "0px"
else:
- x = "0%"
- y = "0%"
- boxStyles = {"BoxTL": "left:" + x + ";top:" + y + ";",
- "BoxTR": "right:" + x + ";top:" + y + ";",
- "BoxBL": "left:" + x + ";bottom:" + y + ";",
- "BoxBR": "right:" + x + ";bottom:" + y + ";",
- "BoxT": "left:-25%;top:" + y + ";",
- "BoxB": "left:-25%;bottom:" + y + ";",
- "BoxL": "left:" + x + ";top:-25%;",
- "BoxR": "right:" + x + ";top:-25%;",
+ xl = "0px"
+ yu = "0px"
+ xr = "0px"
+ yd = "0px"
+ boxStyles = {"BoxTL": "left:" + xl + ";top:" + yu + ";",
+ "BoxTR": "right:" + xr + ";top:" + yu + ";",
+ "BoxBL": "left:" + xl + ";bottom:" + yd + ";",
+ "BoxBR": "right:" + xr + ";bottom:" + yd + ";",
+ "BoxT": "left:-25%;top:" + yu + ";",
+ "BoxB": "left:-25%;bottom:" + yd + ";",
+ "BoxL": "left:" + xl + ";top:-25%;",
+ "BoxR": "right:" + xr + ";top:-25%;",
"BoxC": "right:-25%;top:-25%;"
}
for box in boxes:
@@ -295,7 +308,7 @@ def getImageFileName(imgfile):
return filename
-def applyImgOptimization(img, opt, overrideQuality=5):
+def applyImgOptimization(img, opt, hqImage=None):
if not img.fill:
img.getImageFill(opt.webtoon)
if not opt.webtoon:
@@ -303,8 +316,9 @@ def applyImgOptimization(img, opt, overrideQuality=5):
if opt.cutpagenumbers and not opt.webtoon:
img.cutPageNumber()
img.optimizeImage(opt.gamma)
- if overrideQuality != 5:
- img.resizeImage(opt.upscale, opt.stretch, opt.bordersColor, overrideQuality)
+ if hqImage:
+ img.resizeImage(opt.upscale, opt.stretch, opt.bordersColor, 0)
+ img.calculateBorder(hqImage)
else:
img.resizeImage(opt.upscale, opt.stretch, opt.bordersColor, opt.quality)
if opt.forcepng and not opt.forcecolor:
@@ -378,12 +392,12 @@ def fileImgProcess(work):
applyImgOptimization(img1, opt)
img1.saveToDir(dirpath, opt.forcepng, opt.forcecolor, wipe)
if opt.quality == 2:
- img3 = image.ComicPage(split[0], opt.profileData, img0.fill)
- applyImgOptimization(img3, opt, 0)
- img3.saveToDir(dirpath, opt.forcepng, opt.forcecolor, True)
- img4 = image.ComicPage(split[1], opt.profileData, img1.fill)
- applyImgOptimization(img4, opt, 0)
- img4.saveToDir(dirpath, opt.forcepng, opt.forcecolor, True)
+ img0b = image.ComicPage(split[0], opt.profileData, img0.fill)
+ applyImgOptimization(img0b, opt, img0)
+ img0b.saveToDir(dirpath, opt.forcepng, opt.forcecolor, True)
+ img1b = image.ComicPage(split[1], opt.profileData, img1.fill)
+ applyImgOptimization(img1b, opt, img1)
+ img1b.saveToDir(dirpath, opt.forcepng, opt.forcecolor, True)
else:
applyImgOptimization(img, opt)
img.saveToDir(dirpath, opt.forcepng, opt.forcecolor, wipe)
@@ -392,7 +406,7 @@ def fileImgProcess(work):
if img.rotated:
img2.image = img2.image.rotate(90)
img2.rotated = True
- applyImgOptimization(img2, opt, 0)
+ applyImgOptimization(img2, opt, img)
img2.saveToDir(dirpath, opt.forcepng, opt.forcecolor, True)
except StandardError:
return str(sys.exc_info()[1])
diff --git a/kcc/image.py b/kcc/image.py
index 3e848c38..0144556b 100755
--- a/kcc/image.py
+++ b/kcc/image.py
@@ -201,7 +201,8 @@ class ComicPage:
if self.noVPV:
suffix += "_kccnv"
if self.border:
- suffix += "_kccx" + str(self.border[0]) + "_kccy" + str(self.border[1])
+ suffix += "_kccxl" + str(self.border[0]) + "_kccyu" + str(self.border[1]) + "_kccxr" +\
+ str(self.border[2]) + "_kccyd" + str(self.border[3])
if forcepng:
self.image.save(os.path.join(targetdir, os.path.splitext(self.filename)[0] + suffix + ".png"), "PNG",
optimize=1)
@@ -232,6 +233,23 @@ class ComicPage:
# Quantize is deprecated but new function call it internally anyway...
self.image = self.image.quantize(palette=palImg)
+ def calculateBorder(self, sourceImage):
+ if self.fill == 'white':
+ border = ImageOps.invert(sourceImage.image).getbbox()
+ else:
+ border = sourceImage.image.getbbox()
+ if border is not None:
+ if border[2]-border[0] < self.size[0]:
+ self.noHPV = True
+ if border[3]-border[1] < self.size[1]:
+ self.noVPV = True
+ self.border = [border[0], border[1],
+ sourceImage.image.size[0] - border[2], sourceImage.image.size[1] - border[3]]
+ else:
+ self.border = [0, 0]
+ self.noHPV = True
+ self.noVPV = True
+
def resizeImage(self, upscale=False, stretch=False, bordersColor=None, qualityMode=0):
# High-quality downscaling filter
method = Image.ANTIALIAS
@@ -239,28 +257,17 @@ class ComicPage:
fill = bordersColor
else:
fill = self.fill
+ # Set target size
if qualityMode == 0:
size = (self.size[0], self.size[1])
- generateBorder = True
- elif qualityMode == 1:
- size = (self.panelviewsize[0], self.panelviewsize[1])
- generateBorder = True
else:
size = (self.panelviewsize[0], self.panelviewsize[1])
- generateBorder = False
- # If image is smaller than screen and upscale is off - Just expand it
- if self.image.size[0] <= self.size[0] and self.image.size[1] <= self.size[1]:
+ # If image is smaller than target size and upscale is off - Just expand it by adding margins
+ if self.image.size[0] <= size[0] and self.image.size[1] <= size[1]:
if not upscale:
- borderw = (self.size[0] - self.image.size[0]) / 2
- borderh = (self.size[1] - self.image.size[1]) / 2
+ borderw = (size[0] - self.image.size[0]) / 2
+ borderh = (size[1] - self.image.size[1]) / 2
self.image = ImageOps.expand(self.image, border=(borderw, borderh), fill=fill)
- if generateBorder:
- if (self.image.size[0]-(2*borderw))*1.5 < self.size[0]:
- self.noHPV = True
- if (self.image.size[1]-(2*borderh))*1.5 < self.size[1]:
- self.noVPV = True
- self.border = [int(round(float(borderw)/float(self.image.size[0])*100, 2)*100*1.5),
- int(round(float(borderh)/float(self.image.size[1])*100, 2)*100*1.5)]
return self.image
else:
# Cubic spline interpolation in a 4x4 environment
@@ -268,25 +275,9 @@ class ComicPage:
# If stretching is on - Resize without other considerations
if stretch:
self.image = self.image.resize(size, method)
- if generateBorder:
- if fill == 'white':
- border = ImageOps.invert(self.image).getbbox()
- else:
- border = self.image.getbbox()
- if border is not None:
- if (border[2]-border[0])*1.5 < self.size[0]:
- self.noHPV = True
- if (border[3]-border[1])*1.5 < self.size[1]:
- self.noVPV = True
- self.border = [int(round(float(border[0])/float(self.image.size[0])*100, 2)*100*1.5),
- int(round(float(border[1])/float(self.image.size[1])*100, 2)*100*1.5)]
- else:
- self.border = [0, 0]
- self.noHPV = True
- self.noVPV = True
return self.image
# Otherwise - Upscale/Downscale
- ratioDev = float(self.size[0]) / float(self.size[1])
+ ratioDev = float(size[0]) / float(size[1])
if (float(self.image.size[0]) / float(self.image.size[1])) < ratioDev:
diff = int(self.image.size[1] * ratioDev) - self.image.size[0]
self.image = ImageOps.expand(self.image, border=(diff / 2, 0), fill=fill)
@@ -294,22 +285,6 @@ class ComicPage:
diff = int(self.image.size[0] / ratioDev) - self.image.size[1]
self.image = ImageOps.expand(self.image, border=(0, diff / 2), fill=fill)
self.image = ImageOps.fit(self.image, size, method=method, centering=(0.5, 0.5))
- if generateBorder:
- if fill == 'white':
- border = ImageOps.invert(self.image).getbbox()
- else:
- border = self.image.getbbox()
- if border is not None:
- if (border[2]-border[0])*1.5 < self.size[0]:
- self.noHPV = True
- if (border[3]-border[1])*1.5 < self.size[1]:
- self.noVPV = True
- self.border = [int(round(float(border[0])/float(self.image.size[0])*100, 2)*100*1.5),
- int(round(float(border[1])/float(self.image.size[1])*100, 2)*100*1.5)]
- else:
- self.border = [0, 0]
- self.noHPV = True
- self.noVPV = True
return self.image
def splitPage(self, targetdir, righttoleft=False, rotate=False):
From e5be31f9d5f390d9e633bca7e2574c9002ab0244 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Pawe=C5=82=20Jastrz=C4=99bski?=
Date: Wed, 4 Dec 2013 19:04:54 +0100
Subject: [PATCH 06/17] TrayIcon: Clicking it now properly unminimize window
---
kcc/KCC_gui.py | 1 +
1 file changed, 1 insertion(+)
diff --git a/kcc/KCC_gui.py b/kcc/KCC_gui.py
index 1420f162..05a4b58a 100644
--- a/kcc/KCC_gui.py
+++ b/kcc/KCC_gui.py
@@ -541,6 +541,7 @@ class SystemTrayIcon(QtGui.QSystemTrayIcon):
self.activated.connect(self.catchClicks)
def catchClicks(self):
+ MW.showNormal()
MW.raise_()
MW.activateWindow()
From 3b0e5cc309c58efd921541cdd1597ac62ffeb5dc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Pawe=C5=82=20Jastrz=C4=99bski?=
Date: Thu, 5 Dec 2013 15:41:47 +0100
Subject: [PATCH 07/17] Panel View support overhaul - Round 2
---
kcc/comic2ebook.py | 36 ++++++++++++++++++----------------
kcc/image.py | 48 +++++++++++++++++++++++++++++-----------------
2 files changed, 49 insertions(+), 35 deletions(-)
diff --git a/kcc/comic2ebook.py b/kcc/comic2ebook.py
index 830fabfa..c27ad4a8 100755
--- a/kcc/comic2ebook.py
+++ b/kcc/comic2ebook.py
@@ -142,35 +142,35 @@ def buildHTML(path, imgfile):
xr = borders[2].lstrip("0")
yd = borders[3].lstrip("0")
if xl != "":
- xl = "-" + str(xl) + "px"
+ xl = "-" + str(float(xl)/100) + "%"
else:
- xl = "0px"
+ xl = "0%"
if xr != "":
- xr = "-" + str(xr) + "px"
+ xr = "-" + str(float(xr)/100) + "%"
else:
- xr = "0px"
+ xr = "0%"
if yu != "":
- yu = "-" + str(yu) + "px"
+ yu = "-" + str(float(yu)/100) + "%"
else:
- yu = "0px"
+ yu = "0%"
if yd != "":
- yd = "-" + str(yd) + "px"
+ yd = "-" + str(float(yd)/100) + "%"
else:
- yd = "0px"
+ yd = "0%"
else:
- xl = "0px"
- yu = "0px"
- xr = "0px"
- yd = "0px"
+ xl = "0%"
+ yu = "0%"
+ xr = "0%"
+ yd = "0%"
boxStyles = {"BoxTL": "left:" + xl + ";top:" + yu + ";",
"BoxTR": "right:" + xr + ";top:" + yu + ";",
"BoxBL": "left:" + xl + ";bottom:" + yd + ";",
"BoxBR": "right:" + xr + ";bottom:" + yd + ";",
- "BoxT": "left:-25%;top:" + yu + ";",
- "BoxB": "left:-25%;bottom:" + yd + ";",
- "BoxL": "left:" + xl + ";top:-25%;",
- "BoxR": "right:" + xr + ";top:-25%;",
- "BoxC": "right:-25%;top:-25%;"
+ "BoxT": "left:" + xl + ";top:" + yu + ";",
+ "BoxB": "left:" + xl + ";bottom:" + yd + ";",
+ "BoxL": "left:" + xl + ";top:" + yu + ";",
+ "BoxR": "right:" + xr + ";top:" + yu + ";",
+ "BoxC": "left:" + xl + ";top:" + yu + ";"
}
for box in boxes:
f.writelines([" ratioDev:
diff = int(self.image.size[0] / ratioDev) - self.image.size[1]
self.image = ImageOps.expand(self.image, border=(0, diff / 2), fill=fill)
+ if self.image.size[0] <= size[0] and self.image.size[1] <= size[1]:
+ method = Image.BICUBIC
+ else:
+ method = Image.ANTIALIAS
self.image = ImageOps.fit(self.image, size, method=method, centering=(0.5, 0.5))
return self.image
From 48d3bee225957de73ed8afb6b7f23739f064bdfd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Pawe=C5=82=20Jastrz=C4=99bski?=
Date: Thu, 5 Dec 2013 19:49:29 +0100
Subject: [PATCH 08/17] Upscaling is now default on Kindle Fire HD/HDX models
---
README.md | 1 +
kcc/KCC_gui.py | 8 +++++++-
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 27b8ee08..d79d4912 100644
--- a/README.md
+++ b/README.md
@@ -57,6 +57,7 @@ You can find the latest released binary at the following links:
* Check our [wiki](https://github.com/ciromattia/kcc/wiki/Other-devices) for a list of tested Non-Kindle E-Readers.
* The first image found will be set as the comic's cover.
* All files/directories will be added to EPUB in alphabetical order.
+* Using high/ultra quality output option with Kindle Fire HD/HDX in most cases is just waste of space.
* ComicRack metadata will be parsed only if they are saved in *ComicInfo.xml* file.
### Calibre:
diff --git a/kcc/KCC_gui.py b/kcc/KCC_gui.py
index 05a4b58a..44ea5b26 100644
--- a/kcc/KCC_gui.py
+++ b/kcc/KCC_gui.py
@@ -290,7 +290,7 @@ class KindleUnpackThread(QtCore.QRunnable):
try:
# MOBI file produced by KindleGen is hybrid. KF8 + M7 + Source header
# KindleSplit is removing redundant data as we need only KF8 part for new Kindle models
- if profile in ['K345', 'KHD', 'KF', 'KFHD', 'KFHD8', 'KFHDX8', 'KFA']:
+ if profile in ['K345', 'KHD', 'KF', 'KFHD', 'KFHD8', 'KFHDX', 'KFHDX8', 'KFA']:
newKindle = True
else:
newKindle = False
@@ -354,6 +354,9 @@ class WorkerThread(QtCore.QThread):
argv.append("--quality=1")
elif GUI.QualityBox.checkState() == 2:
argv.append("--quality=2")
+ if GUI.currentMode == 1:
+ if profile in ['KFHD', 'KFHD8', 'KFHDX', 'KFHDX8']:
+ argv.append("--upscale")
if GUI.currentMode > 1:
if GUI.ProcessingBox.isChecked():
argv.append("--noprocessing")
@@ -789,6 +792,9 @@ class KCCGUI(KCC_ui.Ui_KCC):
GUI.QualityBox.setChecked(False)
GUI.QualityBox.setEnabled(False)
self.QualityBoxDisabled = True
+ if value in [4, 5, 6, 7]:
+ if GUI.UpscaleBox.isEnabled():
+ GUI.UpscaleBox.setChecked(True)
else:
if not GUI.WebtoonBox.isChecked() and not GUI.ProcessingBox.isChecked() \
and str(GUI.FormatBox.currentText()) != 'CBZ':
From c46ca8b5072aeff1914849a49e3490a8e60c0a0b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Pawe=C5=82=20Jastrz=C4=99bski?=
Date: Fri, 6 Dec 2013 17:18:20 +0100
Subject: [PATCH 09/17] Updated README + Minor tweaks
---
README.md | 11 ++++++++++-
kcc/KCC_gui.py | 8 ++++----
2 files changed, 14 insertions(+), 5 deletions(-)
diff --git a/README.md b/README.md
index d79d4912..b57fcd5d 100644
--- a/README.md
+++ b/README.md
@@ -24,7 +24,7 @@ You can find the latest released binary at the following links:
- **Windows:** [http://kcc.vulturis.eu/Windows/](http://kcc.vulturis.eu/Windows/)
- **Linux:** [http://kcc.vulturis.eu/Linux/](http://kcc.vulturis.eu/Linux/)
- **OS X (10.8 or later):** [http://kcc.vulturis.eu/OSX/](http://kcc.vulturis.eu/OSX/)
-- **OS X (10.7 or earlier):** [http://kcc.vulturis.eu/Old/OSX/KindleComicConverter_3.6-rc1_osx10.7.zip](http://kcc.vulturis.eu/Old/OSX/KindleComicConverter_3.6-rc1_osx10.7.zip)
+- **OS X (10.7 or earlier):** Soon™
## INPUT FORMATS
**KCC** can understand and convert, at the moment, the following file types:
@@ -294,6 +294,15 @@ The app relies and includes the following scripts/binaries:
* GUI tweaks and minor bug fixes
####3.6:
+* Increased quality of Panel View zoom
+* Creation of multipart MOBI output is now faster on machines with 4GB+ RAM
+* Automatic gamma correction now distinguishes color and grayscale images
+* Added ComicRack metadata parser
+* Implemented new method to detect border color in non-webtoon comics
+* Upscaling is now enabled by default for Kindle Fire HD/HDX
+* Windows nad Linux releases now have tray icon
+* Fixed Kindle Fire HDX 7" output
+* Increased target resolution for Kindle DX/DXG CBZ output
## COPYRIGHT
diff --git a/kcc/KCC_gui.py b/kcc/KCC_gui.py
index 44ea5b26..ccf1d1a4 100644
--- a/kcc/KCC_gui.py
+++ b/kcc/KCC_gui.py
@@ -797,7 +797,7 @@ class KCCGUI(KCC_ui.Ui_KCC):
GUI.UpscaleBox.setChecked(True)
else:
if not GUI.WebtoonBox.isChecked() and not GUI.ProcessingBox.isChecked() \
- and str(GUI.FormatBox.currentText()) != 'CBZ':
+ and str(GUI.FormatBox.currentText()) != 'CBZ' and value not in [9, 11, 12, 13]:
GUI.QualityBox.setEnabled(True)
self.QualityBoxDisabled = False
@@ -981,9 +981,9 @@ class KCCGUI(KCC_ui.Ui_KCC):
self.tray.show()
statusBarLabel = QtGui.QLabel('HOMEPAGE - DONATE - README - WIKI')
+ 'ciromattia/kcc/blob/master/README.md#issues--new-features--donations">DONATE'
+ ' - README<'
+ '/a> - WIKI')
statusBarLabel.setAlignment(QtCore.Qt.AlignCenter)
statusBarLabel.setStyleSheet(self.statusBarStyle)
statusBarLabel.setOpenExternalLinks(True)
From 953942ca0045092803bff17554018e1084944112 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Pawe=C5=82=20Jastrz=C4=99bski?=
Date: Fri, 6 Dec 2013 17:42:11 +0100
Subject: [PATCH 10/17] Fixed tray icon owner
---
kcc/KCC_gui.py | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/kcc/KCC_gui.py b/kcc/KCC_gui.py
index ccf1d1a4..048aec8e 100644
--- a/kcc/KCC_gui.py
+++ b/kcc/KCC_gui.py
@@ -537,10 +537,9 @@ class WorkerThread(QtCore.QThread):
class SystemTrayIcon(QtGui.QSystemTrayIcon):
- def __init__(self, parent=None):
+ def __init__(self):
if not sys.platform.startswith('darwin') and self.isSystemTrayAvailable():
- QtGui.QSystemTrayIcon.__init__(self, parent)
- self.setIcon(GUI.icons.programIcon)
+ QtGui.QSystemTrayIcon.__init__(self, GUI.icons.programIcon, MW)
self.activated.connect(self.catchClicks)
def catchClicks(self):
@@ -882,8 +881,6 @@ class KCCGUI(KCC_ui.Ui_KCC):
event.ignore()
if not GUI.ConvertButton.isEnabled():
event.ignore()
- if not sys.platform.startswith('darwin'):
- self.tray.hide()
self.contentServer.stop()
self.settings.setValue('settingsVersion', __version__)
self.settings.setValue('lastPath', self.lastPath)
From 0cf92fc48fce4a848e186c23abb6ae07857b852f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Pawe=C5=82=20Jastrz=C4=99bski?=
Date: Fri, 6 Dec 2013 17:58:39 +0100
Subject: [PATCH 11/17] Fixed psutil detection
---
kcc/cbxarchive.py | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/kcc/cbxarchive.py b/kcc/cbxarchive.py
index e083d28f..e054dcfa 100644
--- a/kcc/cbxarchive.py
+++ b/kcc/cbxarchive.py
@@ -23,8 +23,20 @@ import os
import zipfile
import rarfile
import locale
+from sys import platform
from subprocess import STDOUT, PIPE
-from psutil import Popen
+try:
+ #noinspection PyUnresolvedReferences
+ from psutil import Popen
+except ImportError:
+ print "ERROR: Psutil is not installed!"
+ if platform.startswith('linux'):
+ import Tkinter
+ import tkMessageBox
+ importRoot = Tkinter.Tk()
+ importRoot.withdraw()
+ tkMessageBox.showerror("KCC - Error", "Psutil is not installed!")
+ exit(1)
from shutil import move
From 11007402cd7a3c0602deceae7209647d113943e4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Pawe=C5=82=20Jastrz=C4=99bski?=
Date: Fri, 6 Dec 2013 23:27:58 +0100
Subject: [PATCH 12/17] Fixed PNG output (sigh!)
---
kcc/image.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kcc/image.py b/kcc/image.py
index 5598df41..ebbb42b1 100755
--- a/kcc/image.py
+++ b/kcc/image.py
@@ -241,7 +241,7 @@ class ComicPage:
def calculateBorder(self, sourceImage):
if self.fill == 'white':
- border = ImageOps.invert(sourceImage.image).getbbox()
+ border = ImageChops.invert(sourceImage.image).getbbox()
else:
border = sourceImage.image.getbbox()
if border is not None:
From 7f5de291743f4a909e16c2106ebf9c9fbebb7069 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Pawe=C5=82=20Jastrz=C4=99bski?=
Date: Fri, 6 Dec 2013 23:33:04 +0100
Subject: [PATCH 13/17] Version Bump
---
README.md | 3 +++
kcc.iss | 2 +-
kcc.py | 2 +-
kcc/KCC_gui.py | 2 +-
kcc/__init__.py | 2 +-
kcc/comic2ebook.py | 2 +-
kcc/comic2panel.py | 2 +-
setup.py | 2 +-
setup.sh | 2 +-
9 files changed, 11 insertions(+), 8 deletions(-)
diff --git a/README.md b/README.md
index b57fcd5d..e56bfe87 100644
--- a/README.md
+++ b/README.md
@@ -304,6 +304,9 @@ The app relies and includes the following scripts/binaries:
* Fixed Kindle Fire HDX 7" output
* Increased target resolution for Kindle DX/DXG CBZ output
+####3.6.1:
+* Fixed PNG output
+
## COPYRIGHT
Copyright (c) 2012-2013 Ciro Mattia Gonano and Paweł Jastrzębski.
diff --git a/kcc.iss b/kcc.iss
index fe6b8071..4f77a62e 100644
--- a/kcc.iss
+++ b/kcc.iss
@@ -1,5 +1,5 @@
#define MyAppName "Kindle Comic Converter"
-#define MyAppVersion "3.6"
+#define MyAppVersion "3.6.1"
#define MyAppPublisher "Ciro Mattia Gonano, Paweł Jastrzębski"
#define MyAppURL "http://kcc.vulturis.eu/"
#define MyAppExeName "KCC.exe"
diff --git a/kcc.py b/kcc.py
index 4d60f5e5..20bb5754 100644
--- a/kcc.py
+++ b/kcc.py
@@ -18,7 +18,7 @@
# TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
-__version__ = '3.6'
+__version__ = '3.6.1'
__license__ = 'ISC'
__copyright__ = '2012-2013, Ciro Mattia Gonano , Pawel Jastrzebski '
__docformat__ = 'restructuredtext en'
diff --git a/kcc/KCC_gui.py b/kcc/KCC_gui.py
index 048aec8e..f30a472c 100644
--- a/kcc/KCC_gui.py
+++ b/kcc/KCC_gui.py
@@ -17,7 +17,7 @@
# TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
-__version__ = '3.6'
+__version__ = '3.6.1'
__license__ = 'ISC'
__copyright__ = '2012-2013, Ciro Mattia Gonano , Pawel Jastrzebski '
__docformat__ = 'restructuredtext en'
diff --git a/kcc/__init__.py b/kcc/__init__.py
index 506ea760..39019dd6 100644
--- a/kcc/__init__.py
+++ b/kcc/__init__.py
@@ -1,4 +1,4 @@
-__version__ = '3.6'
+__version__ = '3.6.1'
__license__ = 'ISC'
__copyright__ = '2012-2013, Ciro Mattia Gonano , Pawel Jastrzebski '
__docformat__ = 'restructuredtext en'
\ No newline at end of file
diff --git a/kcc/comic2ebook.py b/kcc/comic2ebook.py
index c27ad4a8..1ccd0f92 100755
--- a/kcc/comic2ebook.py
+++ b/kcc/comic2ebook.py
@@ -18,7 +18,7 @@
# TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
#
-__version__ = '3.6'
+__version__ = '3.6.1'
__license__ = 'ISC'
__copyright__ = '2012-2013, Ciro Mattia Gonano , Pawel Jastrzebski '
__docformat__ = 'restructuredtext en'
diff --git a/kcc/comic2panel.py b/kcc/comic2panel.py
index d194acdb..c2f0a978 100644
--- a/kcc/comic2panel.py
+++ b/kcc/comic2panel.py
@@ -18,7 +18,7 @@
# TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
#
-__version__ = '3.6'
+__version__ = '3.6.1'
__license__ = 'ISC'
__copyright__ = '2012-2013, Ciro Mattia Gonano , Pawel Jastrzebski '
__docformat__ = 'restructuredtext en'
diff --git a/setup.py b/setup.py
index ace85f90..8e032e30 100644
--- a/setup.py
+++ b/setup.py
@@ -11,7 +11,7 @@ Usage (Windows):
from sys import platform
NAME = "KindleComicConverter"
-VERSION = "3.6"
+VERSION = "3.6.1"
MAIN = "kcc.py"
if platform == "darwin":
diff --git a/setup.sh b/setup.sh
index a36d7f0a..d14cca4e 100644
--- a/setup.sh
+++ b/setup.sh
@@ -1,7 +1,7 @@
#!/bin/bash
# Linux Python package build script
-VERSION="3.6"
+VERSION="3.6.1"
cp kcc.py __main__.py
zip kcc.zip __main__.py kcc/*.py
From acb4dfad8fc3aa1b2529a9b94f124bf286c456df Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Pawe=C5=82=20Jastrz=C4=99bski?=
Date: Sat, 7 Dec 2013 09:52:20 +0100
Subject: [PATCH 14/17] Fixex PNG hotfix
---
kcc/image.py | 3 +++
1 file changed, 3 insertions(+)
diff --git a/kcc/image.py b/kcc/image.py
index ebbb42b1..c247afc9 100755
--- a/kcc/image.py
+++ b/kcc/image.py
@@ -241,6 +241,9 @@ class ComicPage:
def calculateBorder(self, sourceImage):
if self.fill == 'white':
+ # This code trigger only when sourceImage is already saved. So we can break color quantization.
+ if sourceImage.image.mode == 'P':
+ sourceImage.image = sourceImage.image.convert('RGB')
border = ImageChops.invert(sourceImage.image).getbbox()
else:
border = sourceImage.image.getbbox()
From 5bcdc7872578cce1dce01d76ce0338f71a70088e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Pawe=C5=82=20Jastrz=C4=99bski?=
Date: Sat, 7 Dec 2013 14:50:37 +0100
Subject: [PATCH 15/17] Fixed Panel View bugs
---
kcc/comic2ebook.py | 23 +++++++++++++----------
kcc/image.py | 12 +++++++-----
2 files changed, 20 insertions(+), 15 deletions(-)
diff --git a/kcc/comic2ebook.py b/kcc/comic2ebook.py
index 1ccd0f92..eff8ac44 100755
--- a/kcc/comic2ebook.py
+++ b/kcc/comic2ebook.py
@@ -105,9 +105,9 @@ def buildHTML(path, imgfile):
elif noHorizontalPV and not noVerticalPV:
if rotatedPage:
if options.righttoleft:
- order = [2, 1]
- else:
order = [1, 2]
+ else:
+ order = [2, 1]
else:
order = [1, 2]
boxes = ["BoxT", "BoxB"]
@@ -166,11 +166,11 @@ def buildHTML(path, imgfile):
"BoxTR": "right:" + xr + ";top:" + yu + ";",
"BoxBL": "left:" + xl + ";bottom:" + yd + ";",
"BoxBR": "right:" + xr + ";bottom:" + yd + ";",
- "BoxT": "left:" + xl + ";top:" + yu + ";",
- "BoxB": "left:" + xl + ";bottom:" + yd + ";",
- "BoxL": "left:" + xl + ";top:" + yu + ";",
- "BoxR": "right:" + xr + ";top:" + yu + ";",
- "BoxC": "left:" + xl + ";top:" + yu + ";"
+ "BoxT": "left:-25%;top:" + yu + ";",
+ "BoxB": "left:-25%;bottom:" + yd + ";",
+ "BoxL": "left:" + xl + ";top:-25%;",
+ "BoxR": "right:" + xr + ";top:-25%;",
+ "BoxC": "left:-25%;top:-25%;"
}
for box in boxes:
f.writelines(["
Date: Sat, 7 Dec 2013 20:08:20 +0100
Subject: [PATCH 16/17] Version Bump
---
README.md | 4 ++++
kcc.iss | 2 +-
kcc.py | 2 +-
kcc/KCC_gui.py | 2 +-
kcc/__init__.py | 2 +-
kcc/comic2ebook.py | 2 +-
kcc/comic2panel.py | 2 +-
setup.py | 2 +-
setup.sh | 2 +-
9 files changed, 12 insertions(+), 8 deletions(-)
diff --git a/README.md b/README.md
index e56bfe87..fcf64e57 100644
--- a/README.md
+++ b/README.md
@@ -307,6 +307,10 @@ The app relies and includes the following scripts/binaries:
####3.6.1:
* Fixed PNG output
+####3.6.2:
+* Fixed previous PNG output fix
+* Fixed Panel View anomalies
+
## COPYRIGHT
Copyright (c) 2012-2013 Ciro Mattia Gonano and Paweł Jastrzębski.
diff --git a/kcc.iss b/kcc.iss
index 4f77a62e..6b3eeea0 100644
--- a/kcc.iss
+++ b/kcc.iss
@@ -1,5 +1,5 @@
#define MyAppName "Kindle Comic Converter"
-#define MyAppVersion "3.6.1"
+#define MyAppVersion "3.6.2"
#define MyAppPublisher "Ciro Mattia Gonano, Paweł Jastrzębski"
#define MyAppURL "http://kcc.vulturis.eu/"
#define MyAppExeName "KCC.exe"
diff --git a/kcc.py b/kcc.py
index 20bb5754..84a0bcf2 100644
--- a/kcc.py
+++ b/kcc.py
@@ -18,7 +18,7 @@
# TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
-__version__ = '3.6.1'
+__version__ = '3.6.2'
__license__ = 'ISC'
__copyright__ = '2012-2013, Ciro Mattia Gonano
, Pawel Jastrzebski '
__docformat__ = 'restructuredtext en'
diff --git a/kcc/KCC_gui.py b/kcc/KCC_gui.py
index f30a472c..974976b3 100644
--- a/kcc/KCC_gui.py
+++ b/kcc/KCC_gui.py
@@ -17,7 +17,7 @@
# TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
-__version__ = '3.6.1'
+__version__ = '3.6.2'
__license__ = 'ISC'
__copyright__ = '2012-2013, Ciro Mattia Gonano , Pawel Jastrzebski '
__docformat__ = 'restructuredtext en'
diff --git a/kcc/__init__.py b/kcc/__init__.py
index 39019dd6..652089e2 100644
--- a/kcc/__init__.py
+++ b/kcc/__init__.py
@@ -1,4 +1,4 @@
-__version__ = '3.6.1'
+__version__ = '3.6.2'
__license__ = 'ISC'
__copyright__ = '2012-2013, Ciro Mattia Gonano , Pawel Jastrzebski '
__docformat__ = 'restructuredtext en'
\ No newline at end of file
diff --git a/kcc/comic2ebook.py b/kcc/comic2ebook.py
index eff8ac44..5499b140 100755
--- a/kcc/comic2ebook.py
+++ b/kcc/comic2ebook.py
@@ -18,7 +18,7 @@
# TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
#
-__version__ = '3.6.1'
+__version__ = '3.6.2'
__license__ = 'ISC'
__copyright__ = '2012-2013, Ciro Mattia Gonano , Pawel Jastrzebski '
__docformat__ = 'restructuredtext en'
diff --git a/kcc/comic2panel.py b/kcc/comic2panel.py
index c2f0a978..466b35e4 100644
--- a/kcc/comic2panel.py
+++ b/kcc/comic2panel.py
@@ -18,7 +18,7 @@
# TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
#
-__version__ = '3.6.1'
+__version__ = '3.6.2'
__license__ = 'ISC'
__copyright__ = '2012-2013, Ciro Mattia Gonano , Pawel Jastrzebski '
__docformat__ = 'restructuredtext en'
diff --git a/setup.py b/setup.py
index 8e032e30..1a36ef9b 100644
--- a/setup.py
+++ b/setup.py
@@ -11,7 +11,7 @@ Usage (Windows):
from sys import platform
NAME = "KindleComicConverter"
-VERSION = "3.6.1"
+VERSION = "3.6.2"
MAIN = "kcc.py"
if platform == "darwin":
diff --git a/setup.sh b/setup.sh
index d14cca4e..b4487ca5 100644
--- a/setup.sh
+++ b/setup.sh
@@ -1,7 +1,7 @@
#!/bin/bash
# Linux Python package build script
-VERSION="3.6.1"
+VERSION="3.6.2"
cp kcc.py __main__.py
zip kcc.zip __main__.py kcc/*.py
From 80b65b12b74d507806540687550797a1e2b358b3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Pawe=C5=82=20Jastrz=C4=99bski?=
Date: Fri, 13 Dec 2013 19:22:52 +0100
Subject: [PATCH 17/17] Updated tooltips
---
KCC-Linux.ui | 4 ++--
KCC-OSX.ui | 4 ++--
KCC.ui | 4 ++--
kcc/KCC_ui.py | 6 +++---
kcc/KCC_ui_linux.py | 6 +++---
kcc/KCC_ui_osx.py | 6 +++---
6 files changed, 15 insertions(+), 15 deletions(-)
diff --git a/KCC-Linux.ui b/KCC-Linux.ui
index 9ce02215..6d8eaba2 100644
--- a/KCC-Linux.ui
+++ b/KCC-Linux.ui
@@ -416,7 +416,7 @@ p, li { white-space: pre-wrap; }
Qt::NoFocus
- <html><head/><body><p>Disable page spliting.<br/>They will be rotated instead.</p></body></html>
+ <html><head/><body><p>Disable splitting of two-page spreads.<br/>They will be rotated instead.</p></body></html>
Horizontal mode
@@ -635,7 +635,7 @@ p, li { white-space: pre-wrap; }
Qt::NoFocus
- Do not convert images to grayscale.
+ <html><head/><body><p>Don't convert images to grayscale.</p></body></html>
Color mode
diff --git a/KCC-OSX.ui b/KCC-OSX.ui
index 775ab4a2..4896197f 100644
--- a/KCC-OSX.ui
+++ b/KCC-OSX.ui
@@ -416,7 +416,7 @@
Qt::NoFocus
- <html><head/><body><p><span style=" font-size:12pt;">Disable page spliting.<br/>They will be rotated instead.</span></p></body></html>
+ <html><head/><body><p><span style=" font-size:12pt;">Disable splitting of two-page spreads.<br/>They will be rotated instead.</span></p></body></html>
Horizontal mode
@@ -639,7 +639,7 @@
Qt::NoFocus
- <html><head/><body><p><span style=" font-size:12pt;">Do not convert images to grayscale.</span></p></body></html>
+ <html><head/><body><p><span style=" font-size:12pt;">Don't convert images to grayscale.</span></p></body></html>
Color mode
diff --git a/KCC.ui b/KCC.ui
index bd093790..67259156 100644
--- a/KCC.ui
+++ b/KCC.ui
@@ -363,7 +363,7 @@ p, li { white-space: pre-wrap; }
Qt::NoFocus
- <html><head/><body><p>Disable page spliting.<br/>They will be rotated instead.</p></body></html>
+ <html><head/><body><p>Disable splitting of two-page spreads.<br/>They will be rotated instead.</p></body></html>
Horizontal mode
@@ -549,7 +549,7 @@ p, li { white-space: pre-wrap; }
Qt::NoFocus
- Do not convert images to grayscale.
+ <html><head/><body><p>Don't convert images to grayscale.</p></body></html>
Color mode
diff --git a/kcc/KCC_ui.py b/kcc/KCC_ui.py
index 60e4672e..971239a9 100644
--- a/kcc/KCC_ui.py
+++ b/kcc/KCC_ui.py
@@ -2,7 +2,7 @@
# Form implementation generated from reading ui file 'KCC.ui'
#
-# Created: Wed Dec 04 18:28:13 2013
+# Created: Fri Dec 13 19:22:05 2013
# by: PyQt4 UI code generator 4.10.3
#
# WARNING! All changes made in this file will be lost!
@@ -301,12 +301,12 @@ class Ui_KCC(object):
"Indeterminate - High quality mode
Not zoomed image might be a little blurry.
- Medium/High quality when zoom is not enabled.
- Maximum quality when zoom is enabled.
\n"
"Checked - Ultra quality mode
Maximum possible quality.
- Maximum quality when zoom is not enabled.
- Maximum quality when zoom is enabled.
- Very high file size.
", None))
self.QualityBox.setText(_translate("KCC", "High/Ultra quality", None))
- self.RotateBox.setToolTip(_translate("KCC", "Disable page spliting.
They will be rotated instead.
", None))
+ self.RotateBox.setToolTip(_translate("KCC", "Disable splitting of two-page spreads.
They will be rotated instead.
", None))
self.RotateBox.setText(_translate("KCC", "Horizontal mode", None))
self.BasicModeButton.setText(_translate("KCC", "Basic", None))
self.AdvModeButton.setText(_translate("KCC", "Advanced", None))
self.GammaLabel.setText(_translate("KCC", "Gamma: Auto", None))
- self.ColorBox.setToolTip(_translate("KCC", "Do not convert images to grayscale.", None))
+ self.ColorBox.setToolTip(_translate("KCC", "Don\'t convert images to grayscale.
", None))
self.ColorBox.setText(_translate("KCC", "Color mode", None))
self.wLabel.setToolTip(_translate("KCC", "Resolution of target device.", None))
self.wLabel.setText(_translate("KCC", "Custom width: ", None))
diff --git a/kcc/KCC_ui_linux.py b/kcc/KCC_ui_linux.py
index 372006a9..4aba880d 100644
--- a/kcc/KCC_ui_linux.py
+++ b/kcc/KCC_ui_linux.py
@@ -2,7 +2,7 @@
# Form implementation generated from reading ui file 'KCC-Linux.ui'
#
-# Created: Wed Dec 04 18:27:52 2013
+# Created: Fri Dec 13 19:22:17 2013
# by: PyQt4 UI code generator 4.10.3
#
# WARNING! All changes made in this file will be lost!
@@ -370,12 +370,12 @@ class Ui_KCC(object):
"Indeterminate - High quality mode
Not zoomed image might be a little blurry.
- Medium/High quality when zoom is not enabled.
- Maximum quality when zoom is enabled.
\n"
"Checked - Ultra quality mode
Maximum possible quality.
- Maximum quality when zoom is not enabled.
- Maximum quality when zoom is enabled.
- Very high file size.
", None))
self.QualityBox.setText(_translate("KCC", "High/Ultra quality", None))
- self.RotateBox.setToolTip(_translate("KCC", "Disable page spliting.
They will be rotated instead.
", None))
+ self.RotateBox.setToolTip(_translate("KCC", "Disable splitting of two-page spreads.
They will be rotated instead.
", None))
self.RotateBox.setText(_translate("KCC", "Horizontal mode", None))
self.BasicModeButton.setText(_translate("KCC", "Basic", None))
self.AdvModeButton.setText(_translate("KCC", "Advanced", None))
self.GammaLabel.setText(_translate("KCC", "Gamma: Auto", None))
- self.ColorBox.setToolTip(_translate("KCC", "Do not convert images to grayscale.", None))
+ self.ColorBox.setToolTip(_translate("KCC", "Don\'t convert images to grayscale.
", None))
self.ColorBox.setText(_translate("KCC", "Color mode", None))
self.wLabel.setToolTip(_translate("KCC", "Resolution of target device.", None))
self.wLabel.setText(_translate("KCC", "Custom width: ", None))
diff --git a/kcc/KCC_ui_osx.py b/kcc/KCC_ui_osx.py
index b8e8d150..2c0ddb36 100644
--- a/kcc/KCC_ui_osx.py
+++ b/kcc/KCC_ui_osx.py
@@ -2,7 +2,7 @@
# Form implementation generated from reading ui file 'KCC-OSX.ui'
#
-# Created: Wed Dec 04 18:28:04 2013
+# Created: Fri Dec 13 19:22:27 2013
# by: PyQt4 UI code generator 4.10.3
#
# WARNING! All changes made in this file will be lost!
@@ -388,12 +388,12 @@ class Ui_KCC(object):
self.MangaBox.setText(_translate("KCC", "Manga mode", None))
self.QualityBox.setToolTip(_translate("KCC", "Unchecked - Normal quality mode
Use it when Panel View support is not needed.
- Maximum quality when zoom is not enabled.
- Poor quality when zoom is enabled.
- Lowest file size.
Indeterminate - High quality mode
Not zoomed image might be a little blurry.
- Medium/High quality when zoom is not enabled.
- Maximum quality when zoom is enabled.
Checked - Ultra quality mode
Maximum possible quality.
- Maximum quality when zoom is not enabled.
- Maximum quality when zoom is enabled.
- Very high file size.
", None))
self.QualityBox.setText(_translate("KCC", "High/Ultra quality", None))
- self.RotateBox.setToolTip(_translate("KCC", "Disable page spliting.
They will be rotated instead.
", None))
+ self.RotateBox.setToolTip(_translate("KCC", "Disable splitting of two-page spreads.
They will be rotated instead.
", None))
self.RotateBox.setText(_translate("KCC", "Horizontal mode", None))
self.BasicModeButton.setText(_translate("KCC", "Basic", None))
self.AdvModeButton.setText(_translate("KCC", "Advanced", None))
self.GammaLabel.setText(_translate("KCC", "Gamma: Auto", None))
- self.ColorBox.setToolTip(_translate("KCC", "Do not convert images to grayscale.
", None))
+ self.ColorBox.setToolTip(_translate("KCC", "Don\'t convert images to grayscale.
", None))
self.ColorBox.setText(_translate("KCC", "Color mode", None))
self.wLabel.setToolTip(_translate("KCC", "Resolution of target device.
", None))
self.wLabel.setText(_translate("KCC", "Custom width: ", None))