mirror of
https://github.com/ciromattia/kcc
synced 2026-04-16 05:58:52 +00:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e835502837 | ||
|
|
5bcdc78725 | ||
|
|
acb4dfad8f |
@@ -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.
|
||||
|
||||
2
kcc.iss
2
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"
|
||||
|
||||
2
kcc.py
2
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 <ciromattia@gmail.com>, Pawel Jastrzebski <pawelj@vulturis.eu>'
|
||||
__docformat__ = 'restructuredtext en'
|
||||
|
||||
@@ -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 <ciromattia@gmail.com>, Pawel Jastrzebski <pawelj@vulturis.eu>'
|
||||
__docformat__ = 'restructuredtext en'
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
__version__ = '3.6.1'
|
||||
__version__ = '3.6.2'
|
||||
__license__ = 'ISC'
|
||||
__copyright__ = '2012-2013, Ciro Mattia Gonano <ciromattia@gmail.com>, Pawel Jastrzebski <pawelj@vulturis.eu>'
|
||||
__docformat__ = 'restructuredtext en'
|
||||
@@ -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 <ciromattia@gmail.com>, Pawel Jastrzebski <pawelj@vulturis.eu>'
|
||||
__docformat__ = 'restructuredtext en'
|
||||
@@ -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(["<div id=\"" + box + "-Panel-Parent\" class=\"target-mag-parent\"><div id=\"",
|
||||
@@ -318,11 +318,14 @@ def applyImgOptimization(img, opt, hqImage=None):
|
||||
img.optimizeImage(opt.gamma)
|
||||
if hqImage:
|
||||
img.resizeImage(opt.upscale, opt.stretch, opt.bordersColor, 0)
|
||||
img.calculateBorder(hqImage)
|
||||
img.calculateBorder(hqImage, True)
|
||||
else:
|
||||
img.resizeImage(opt.upscale, opt.stretch, opt.bordersColor, opt.quality)
|
||||
if opt.panelview and opt.quality != 2:
|
||||
img.calculateBorder(img)
|
||||
if opt.panelview:
|
||||
if opt.quality == 0:
|
||||
img.calculateBorder(img)
|
||||
elif opt.quality == 1:
|
||||
img.calculateBorder(img, True)
|
||||
if opt.forcepng and not opt.forcecolor:
|
||||
img.quantizeImage()
|
||||
|
||||
|
||||
@@ -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 <ciromattia@gmail.com>, Pawel Jastrzebski <pawelj@vulturis.eu>'
|
||||
__docformat__ = 'restructuredtext en'
|
||||
|
||||
15
kcc/image.py
15
kcc/image.py
@@ -239,22 +239,27 @@ class ComicPage:
|
||||
else:
|
||||
return int(round(float(x)/float(img.image.size[1]), 4) * 10000 * 1.5)
|
||||
|
||||
def calculateBorder(self, sourceImage):
|
||||
def calculateBorder(self, sourceImage, isHQ=False):
|
||||
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()
|
||||
if border is not None:
|
||||
if isHQ:
|
||||
multiplier = 1.0
|
||||
else:
|
||||
multiplier = 1.5
|
||||
self.border = [self.calculateBorderPercent(border[0], sourceImage, True),
|
||||
self.calculateBorderPercent(border[1], sourceImage, False),
|
||||
self.calculateBorderPercent((sourceImage.image.size[0] - border[2]), sourceImage, True),
|
||||
self.calculateBorderPercent((sourceImage.image.size[1] - border[3]), sourceImage, False)]
|
||||
if int((border[2] - border[0]) * 1.5) < self.size[0]:
|
||||
if int((border[2] - border[0]) * multiplier) < self.size[0]:
|
||||
self.noHPV = True
|
||||
self.border[0] /= 2
|
||||
if int((border[3] - border[1]) * 1.5) < self.size[1]:
|
||||
if int((border[3] - border[1]) * multiplier) < self.size[1]:
|
||||
self.noVPV = True
|
||||
self.border[1] /= 2
|
||||
else:
|
||||
self.border = [0, 0, 0, 0]
|
||||
self.noHPV = True
|
||||
|
||||
2
setup.py
2
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":
|
||||
|
||||
Reference in New Issue
Block a user