mirror of https://github.com/GNOME/gimp.git
plug-ins: be a little more forgiving loading g3 fax images.
Only count a broken line once and only stop after at least 10 consecutive broken lines since older fax images are known for having bad lines. This enables loading the image in issues #475.
This commit is contained in:
parent
1edd114834
commit
fd2aa645af
|
@ -227,6 +227,7 @@ load_image (GFile *file,
|
|||
int color;
|
||||
int i, rr, rsize;
|
||||
int cons_eol;
|
||||
int last_eol_row;
|
||||
|
||||
GimpImage *image = NULL;
|
||||
gint bperrow = MAX_COLS/8; /* bytes per bit row */
|
||||
|
@ -263,6 +264,7 @@ load_image (GFile *file,
|
|||
data = 0;
|
||||
|
||||
cons_eol = 0; /* consecutive EOLs read - zero yet */
|
||||
last_eol_row = 0;
|
||||
|
||||
color = 0; /* start with white */
|
||||
rr = 0;
|
||||
|
@ -298,7 +300,7 @@ load_image (GFile *file,
|
|||
|
||||
bp = &bitmap[row * MAX_COLS / 8];
|
||||
|
||||
while (rs > 0 && cons_eol < 4) /* i.e., while (!EOF) */
|
||||
while (rs > 0 && cons_eol < 10) /* i.e., while (!EOF) */
|
||||
{
|
||||
#ifdef DEBUG
|
||||
g_printerr ("hibit=%2d, data=", hibit);
|
||||
|
@ -440,7 +442,11 @@ load_image (GFile *file,
|
|||
|
||||
if (col == 0)
|
||||
{
|
||||
cons_eol++; /* consecutive EOLs */
|
||||
if (last_eol_row != row)
|
||||
{
|
||||
cons_eol++; /* consecutive EOLs */
|
||||
last_eol_row = row;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue