mirror of
https://github.com/ciromattia/kcc
synced 2026-05-17 13:01:42 +00:00
Merge branch 'master' into HorizontalPanelView
Conflicts: kcc/comic2ebook.py
This commit is contained in:
@@ -134,6 +134,7 @@ The app relies and includes the following scripts/binaries:
|
|||||||
Rarfile library updated to 2.6
|
Rarfile library updated to 2.6
|
||||||
Added GIF, TIFF and BMP to supported formats (#42)
|
Added GIF, TIFF and BMP to supported formats (#42)
|
||||||
Filenames slugifications (#28, #31, #9, #8)
|
Filenames slugifications (#28, #31, #9, #8)
|
||||||
|
- 2.10: Kindle Fire support (color ePub/Mobi)
|
||||||
|
|
||||||
|
|
||||||
## COPYRIGHT
|
## COPYRIGHT
|
||||||
|
|||||||
15
kcc/image.py
15
kcc/image.py
@@ -84,7 +84,10 @@ class ProfileData:
|
|||||||
'K4T': ("Kindle Touch", (600, 800), Palette16, 1.8, (900, 1200)),
|
'K4T': ("Kindle Touch", (600, 800), Palette16, 1.8, (900, 1200)),
|
||||||
'KHD': ("Kindle Paperwhite", (758, 1024), Palette16, 1.8, (1137, 1536)),
|
'KHD': ("Kindle Paperwhite", (758, 1024), Palette16, 1.8, (1137, 1536)),
|
||||||
'KDX': ("Kindle DX", (824, 1200), Palette15, 1.8, (1236, 1800)),
|
'KDX': ("Kindle DX", (824, 1200), Palette15, 1.8, (1236, 1800)),
|
||||||
'KDXG': ("Kindle DXG", (824, 1200), Palette16, 1.8, (1236, 1800))
|
'KDXG': ("Kindle DXG", (824, 1200), Palette16, 1.8, (1236, 1800)),
|
||||||
|
'KF': ("Kindle Fire", (600, 1024), Palette16, 1.0, (900, 1536)),
|
||||||
|
'KFHD': ("Kindle Fire HD 7\"", (800, 1280), Palette16, 1.0, (1200, 1920)),
|
||||||
|
'KFHD8': ("Kindle Fire HD 8.9\"", (1200, 1920), Palette16, 1.0, (1800, 2880))
|
||||||
}
|
}
|
||||||
|
|
||||||
ProfileLabels = {
|
ProfileLabels = {
|
||||||
@@ -95,7 +98,10 @@ class ProfileData:
|
|||||||
"Kindle 4/Touch": 'K4T',
|
"Kindle 4/Touch": 'K4T',
|
||||||
"Kindle Paperwhite": 'KHD',
|
"Kindle Paperwhite": 'KHD',
|
||||||
"Kindle DX": 'KDX',
|
"Kindle DX": 'KDX',
|
||||||
"Kindle DXG": 'KDXG'
|
"Kindle DXG": 'KDXG',
|
||||||
|
"Kindle Fire": 'KF',
|
||||||
|
"Kindle Fire HD 7\"": 'KFHD',
|
||||||
|
"Kindle Fire HD 8.9\"": 'KFHD8'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -113,10 +119,11 @@ class ComicPage:
|
|||||||
raise RuntimeError('Cannot read image file %s' % source)
|
raise RuntimeError('Cannot read image file %s' % source)
|
||||||
self.image = self.image.convert('RGB')
|
self.image = self.image.convert('RGB')
|
||||||
|
|
||||||
def saveToDir(self, targetdir, forcepng):
|
def saveToDir(self, targetdir, forcepng, color):
|
||||||
filename = os.path.basename(self.origFileName)
|
filename = os.path.basename(self.origFileName)
|
||||||
try:
|
try:
|
||||||
self.image = self.image.convert('L') # convert to grayscale
|
if not color:
|
||||||
|
self.image = self.image.convert('L') # convert to grayscale
|
||||||
os.remove(os.path.join(targetdir, filename))
|
os.remove(os.path.join(targetdir, filename))
|
||||||
if forcepng:
|
if forcepng:
|
||||||
self.image.save(os.path.join(targetdir, os.path.splitext(filename)[0] + ".png"), "PNG")
|
self.image.save(os.path.join(targetdir, os.path.splitext(filename)[0] + ".png"), "PNG")
|
||||||
|
|||||||
Reference in New Issue
Block a user