diff --git a/src/calibre/utils/img.py b/src/calibre/utils/img.py index 68244cd759..3278fbc1e6 100644 --- a/src/calibre/utils/img.py +++ b/src/calibre/utils/img.py @@ -151,9 +151,9 @@ def image_to_data(img, compression_quality=95, fmt='JPEG', png_compression_level if img.hasAlphaChannel(): img = blend_image(img) # QImageWriter only gained the following options in Qt 5.5 - if jpeg_optimized and hasattr(QImageWriter, 'setOptimizedWrite'): + if jpeg_optimized: w.setOptimizedWrite(True) - if jpeg_progressive and hasattr(QImageWriter, 'setProgressiveScanWrite'): + if jpeg_progressive: w.setProgressiveScanWrite(True) w.setQuality(compression_quality) elif fmt == 'PNG':