[gimp/gimp-2-10] plug-ins: be a little more forgiving loading g3 fax images.
- From: Jacob Boerema <jboerema src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp/gimp-2-10] plug-ins: be a little more forgiving loading g3 fax images.
- Date: Fri, 5 Mar 2021 19:35:35 +0000 (UTC)
commit c7f8e505deda90114ea19e57d094a43e94aeed79
Author: Jacob Boerema <jgboerema gmail com>
Date: Fri Mar 5 14:11:42 2021 -0500
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.
(cherry picked from commit fd2aa645afa409f8e3cebf460e7a75bdb0e7c645)
plug-ins/file-faxg3/faxg3.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/plug-ins/file-faxg3/faxg3.c b/plug-ins/file-faxg3/faxg3.c
index d219697c0b..905075a725 100644
--- a/plug-ins/file-faxg3/faxg3.c
+++ b/plug-ins/file-faxg3/faxg3.c
@@ -207,6 +207,7 @@ load_image (const gchar *filename,
int color;
int i, rr, rsize;
int cons_eol;
+ int last_eol_row;
gint32 image_id;
gint bperrow = MAX_COLS/8; /* bytes per bit row */
@@ -241,6 +242,7 @@ load_image (const gchar *filename,
data = 0;
cons_eol = 0; /* consecutive EOLs read - zero yet */
+ last_eol_row = 0;
color = 0; /* start with white */
rr = 0;
@@ -276,7 +278,7 @@ load_image (const gchar *filename,
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);
@@ -418,7 +420,11 @@ load_image (const gchar *filename,
if (col == 0)
{
- cons_eol++; /* consecutive EOLs */
+ if (last_eol_row != row)
+ {
+ cons_eol++; /* consecutive EOLs */
+ last_eol_row = row;
+ }
}
else
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]