mirror of
https://github.com/ciromattia/kcc
synced 2025-12-13 01:36:27 +00:00
restore imgMetadata dict (#858)
* Revert "memory optimization: store metadata in filenames, not a global dict (…"
This reverts commit 9a2a09eab9.
* only remove imgOld
This commit is contained in:
@@ -299,12 +299,13 @@ class ComicPage:
|
||||
|
||||
def saveToDir(self):
|
||||
try:
|
||||
flags = []
|
||||
if not self.opt.forcecolor and not self.opt.forcepng:
|
||||
self.image = self.image.convert('L')
|
||||
if self.rotated:
|
||||
self.targetPath += '-Rotated'
|
||||
flags.append('Rotated')
|
||||
if self.fill != 'white':
|
||||
self.targetPath += '-BlackBackground'
|
||||
flags.append('BlackBackground')
|
||||
if self.opt.forcepng:
|
||||
self.image.info["transparency"] = None
|
||||
self.targetPath += '.png'
|
||||
@@ -322,7 +323,7 @@ class ComicPage:
|
||||
self.image.save(self.targetPath, 'JPEG', optimize=1, quality=85)
|
||||
if os.path.isfile(self.orgPath):
|
||||
os.remove(self.orgPath)
|
||||
return Path(self.targetPath).name
|
||||
return [Path(self.targetPath).name, flags]
|
||||
except IOError as err:
|
||||
raise RuntimeError('Cannot save image. ' + str(err))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user