mirror of
https://github.com/janeczku/calibre-web
synced 2025-06-22 16:24:11 +00:00
Transform color space to srgb instead of rgb to prevent dark images
This commit is contained in:
parent
e7c2a85fd4
commit
e4f1ce9c5a
@ -36,7 +36,7 @@ def cover_processing(tmp_file_path, img, extension):
|
|||||||
if use_IM:
|
if use_IM:
|
||||||
with Image(blob=img) as imgc:
|
with Image(blob=img) as imgc:
|
||||||
imgc.format = 'jpeg'
|
imgc.format = 'jpeg'
|
||||||
imgc.transform_colorspace('rgb')
|
imgc.transform_colorspace('srgb')
|
||||||
imgc.save(filename=tmp_cover_name)
|
imgc.save(filename=tmp_cover_name)
|
||||||
return tmp_cover_name
|
return tmp_cover_name
|
||||||
else:
|
else:
|
||||||
|
@ -905,7 +905,7 @@ def save_cover(img, book_path):
|
|||||||
else:
|
else:
|
||||||
imgc = Image(blob=io.BytesIO(img.content))
|
imgc = Image(blob=io.BytesIO(img.content))
|
||||||
imgc.format = 'jpeg'
|
imgc.format = 'jpeg'
|
||||||
imgc.transform_colorspace("rgb")
|
imgc.transform_colorspace("srgb")
|
||||||
img = imgc
|
img = imgc
|
||||||
except (BlobError, MissingDelegateError):
|
except (BlobError, MissingDelegateError):
|
||||||
log.error("Invalid cover file content")
|
log.error("Invalid cover file content")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user