Merge branch 'MasterPlexus-png-news-compression' of https://github.com/MasterPlexus/calibre

This commit is contained in:
Kovid Goyal 2024-11-09 07:59:51 +05:30
commit 00d4214857
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -460,7 +460,7 @@ class RecursiveFetcher:
if itype not in {'png', 'jpg', 'jpeg'}:
itype = 'png' if itype == 'gif' else 'jpeg'
data = image_to_data(img, fmt=itype)
if self.compress_news_images and itype in {'jpg','jpeg'}:
if self.compress_news_images and itype in {'png','jpg','jpeg'}:
try:
data = self.rescale_image(data)
except Exception: