mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 18:54:09 -04:00
Comic input: Fix a bug in the normalize image filter that caused a crash when converting comics that contain a page with only a single color. Fixes #1704778 [Issue converting CBR into PDF](https://bugs.launchpad.net/calibre/+bug/1704778)
This commit is contained in:
parent
172e044f3f
commit
c5cb5654c9
@ -684,7 +684,7 @@ QImage normalize(const QImage &image) { // {{{
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
memset(&intensity, 0, sizeof(IntegerPixel));
|
memset(&intensity, 0, sizeof(IntegerPixel));
|
||||||
for(high.green=high.red; high.green != low.red; --high.green){
|
for(high.green=high.red; high.green > low.red; --high.green){
|
||||||
intensity.green += histogram[high.green].green;
|
intensity.green += histogram[high.green].green;
|
||||||
if(intensity.green > threshold_intensity)
|
if(intensity.green > threshold_intensity)
|
||||||
break;
|
break;
|
||||||
@ -696,7 +696,7 @@ QImage normalize(const QImage &image) { // {{{
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
memset(&intensity, 0, sizeof(IntegerPixel));
|
memset(&intensity, 0, sizeof(IntegerPixel));
|
||||||
for(high.blue=high.green; high.blue != low.green; --high.blue){
|
for(high.blue=high.green; high.blue > low.green; --high.blue){
|
||||||
intensity.blue += histogram[high.blue].blue;
|
intensity.blue += histogram[high.blue].blue;
|
||||||
if(intensity.blue > threshold_intensity)
|
if(intensity.blue > threshold_intensity)
|
||||||
break;
|
break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user