From 5680cc22992b59533dc2fc4f9bbbe6aa1ed5f9a6 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 5 May 2016 19:29:14 +0530 Subject: [PATCH] Fix new border removal for transparent PNG files not working --- src/calibre/utils/imageops/imageops.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/calibre/utils/imageops/imageops.cpp b/src/calibre/utils/imageops/imageops.cpp index 1e575f5166..7808c5840d 100644 --- a/src/calibre/utils/imageops/imageops.cpp +++ b/src/calibre/utils/imageops/imageops.cpp @@ -46,7 +46,7 @@ QImage* remove_borders(const QImage &image, double fuzz) { unsigned int width = img.width(), height = img.height(); unsigned int top_border = 0, bottom_border = 0, left_border = 0, right_border = 0; - if (img.format() != QImage::Format_RGB32) { + if (img.format() != QImage::Format_RGB32 && img.format() != QImage::Format_ARGB32) { img = img.convertToFormat(QImage::Format_RGB32); if (img.isNull()) { PyErr_NoMemory(); return NULL; } }