]> git.ipfire.org Git - thirdparty/HylaFAX.git/commitdiff
Bug 223: fix error in tiffcheck not catching needed reformatting on
authorLee Howard <faxguy@howardsilvan.com>
Wed, 17 Aug 2005 21:52:03 +0000 (21:52 +0000)
committerLee Howard <faxguy@howardsilvan.com>
Wed, 17 Aug 2005 21:52:03 +0000 (21:52 +0000)
         MH and MR documents when "-3" was used.

CHANGES
util/tiffcheck.c++

diff --git a/CHANGES b/CHANGES
index 7882351da0537ff7b7b1e46727377d5538837bfd..250284eb6391c417e12304d6cbb548b753487a63 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -2,6 +2,7 @@
 
 Changelog for HylaFAX 4.2.2
 
+* fix error of tiffcheck missing needed reformatting (17 Aug 2005)
 * add workaround for a bug in recent versions of gawk (15 Aug 2005)
 * fix send error causing ECM data to not get sent (15 Aug 2005)
 * homogenize default user id for user files (9 Aug 2005)
index 866ae4c26f2cc98ca44abea28232a6a2818006b1..7e14b0f0ef36b437197c140a6522c6aef463a10a 100644 (file)
@@ -161,21 +161,22 @@ checkPageFormat(TIFF* tif, fxStr& emsg)
     }
     uint16 compression = 0;
     (void) TIFFGetField(tif, TIFFTAG_COMPRESSION, &compression);
-    if (compression != COMPRESSION_CCITTFAX3 && compression != COMPRESSION_CCITTFAX4) {
-       emsg.append("Document requires reformatting, not in Group 3 or Group 4 format.\n");
-       status |= REFORMAT;
-    }
-    if (!useMMR && compression == COMPRESSION_CCITTFAX4) {
-       emsg.append("Document requires reformatting, "
-           "client is incapable of receiving 2DMMR data.\n");
-       status |= REFORMAT;
-    }
-    uint32 g3opts = 0;
-    (void) TIFFGetField(tif, TIFFTAG_GROUP3OPTIONS, &g3opts);
-    if ((g3opts ^ dataFormat) & GROUP3OPT_2DENCODING) {
-       emsg.append("Document requires reformatting, "
-           "client is incapable of receiving 2DMR data.\n");
-       status |= REFORMAT;
+    if (useMMR) {
+       if (compression != COMPRESSION_CCITTFAX4) {
+           emsg.append("Document requires reformatting, not in Group 4 format.\n");
+           status |= REFORMAT;
+       }
+    } else {
+       if (compression != COMPRESSION_CCITTFAX3) {
+           emsg.append("Document requires reformatting, not in Group 3 format.\n");
+           status |= REFORMAT;
+       }
+       uint32 g3opts = 0;
+       (void) TIFFGetField(tif, TIFFTAG_GROUP3OPTIONS, &g3opts);
+       if ((g3opts ^ dataFormat) & GROUP3OPT_2DENCODING) {
+           emsg.append("Document requires reformatting, not in 2DMR format.\n");
+           status |= REFORMAT;
+       }
     }
     /*
      * FaxSend can handle multistrip MH and MR images (not MMR),