mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix new border removal for transparent PNG files not working
This commit is contained in:
parent
8c06b18e69
commit
5680cc2299
@ -46,7 +46,7 @@ QImage* remove_borders(const QImage &image, double fuzz) {
|
|||||||
unsigned int width = img.width(), height = img.height();
|
unsigned int width = img.width(), height = img.height();
|
||||||
unsigned int top_border = 0, bottom_border = 0, left_border = 0, right_border = 0;
|
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);
|
img = img.convertToFormat(QImage::Format_RGB32);
|
||||||
if (img.isNull()) { PyErr_NoMemory(); return NULL; }
|
if (img.isNull()) { PyErr_NoMemory(); return NULL; }
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user