1
0
mirror of https://github.com/ciromattia/kcc synced 2025-12-13 01:36:27 +00:00

rename images before processing to fix splitting issues (#852)

* rename images before processing to fix splitting issues

* import pathlib

* 9999 page limit
This commit is contained in:
Alex Xu
2025-03-07 07:59:04 -08:00
committed by GitHub
parent e1f9d12676
commit 9e204aad76
2 changed files with 7 additions and 14 deletions

View File

@@ -20,6 +20,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import io
import os
from pathlib import Path
import mozjpeg_lossless_optimization
from PIL import Image, ImageOps, ImageStat, ImageChops, ImageFilter
from .page_number_crop_alg import get_bbox_crop_margin_page_number, get_bbox_crop_margin
@@ -320,7 +321,7 @@ class ComicPage:
output_jpeg_file.write(output_jpeg_bytes)
else:
self.image.save(self.targetPath, 'JPEG', optimize=1, quality=85)
return [self.targetPath, flags, self.orgPath]
return [Path(self.targetPath).name, flags, self.orgPath]
except IOError as err:
raise RuntimeError('Cannot save image. ' + str(err))