1
0
mirror of https://github.com/ciromattia/kcc synced 2026-04-16 05:58:52 +00:00

Compare commits

...

3 Commits
3.6.1 ... 3.6.2

Author SHA1 Message Date
Paweł Jastrzębski
e835502837 Version Bump 2013-12-07 20:08:20 +01:00
Paweł Jastrzębski
5bcdc78725 Fixed Panel View bugs 2013-12-07 14:50:37 +01:00
Paweł Jastrzębski
acb4dfad8f Fixex PNG hotfix 2013-12-07 09:52:20 +01:00
10 changed files with 35 additions and 23 deletions

View File

@@ -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.

View File

@@ -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
View File

@@ -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'

View File

@@ -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'

View File

@@ -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'

View File

@@ -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()

View File

@@ -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'

View File

@@ -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

View File

@@ -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":

View File

@@ -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