1
0
mirror of https://github.com/ciromattia/kcc synced 2025-12-16 03:06:33 +00:00

Windows: Fixed possible problems with file locks

OSX: Tweaked last fix
This commit is contained in:
Paweł Jastrzębski
2014-01-23 11:23:58 +01:00
parent e4750fc965
commit 162c146bed
3 changed files with 18 additions and 12 deletions

View File

@@ -117,15 +117,13 @@ class ComicPage:
else:
self.fill = None
def saveToDir(self, targetdir, forcepng, color, wipe):
def saveToDir(self, targetdir, forcepng, color):
try:
suffix = ""
if not color and not forcepng:
self.image = self.image.convert('L')
if self.rotated:
suffix += "-kccrot"
if wipe:
os.remove(os.path.join(targetdir, self.filename))
else:
suffix += "-kcchq"
if self.noPV:
@@ -284,7 +282,6 @@ class ComicPage:
pagetwo = self.image.crop(rightbox)
pageone.save(fileone)
pagetwo.save(filetwo)
os.remove(self.origFileName)
except IOError as e:
raise RuntimeError('Cannot write image in directory %s: %s' % (targetdir, e))
return fileone, filetwo