]> git.saurik.com Git - wxWidgets.git/blobdiff - src/tiff/tools/tiffdither.c
let wxCheckListBox get the properties of wxCheckListBoxBase (was wxListBox) for wxGTK...
[wxWidgets.git] / src / tiff / tools / tiffdither.c
index 360c6bfc6be85c5ea89e5755680bc3b0b4bb0738..08eb59df9c14c5905ac035fe43d4237bb9fe70b6 100644 (file)
 # include <unistd.h>
 #endif
 
+#ifdef NEED_LIBPORT
+# include "libport.h"
+#endif
+
 #include "tiffio.h"
 
 #define        streq(a,b)      (strcmp(a,b) == 0)
@@ -77,7 +81,8 @@ fsdither(TIFF* in, TIFF* out)
         * Get first line
         */
        if (TIFFReadScanline(in, inputline, 0, 0) <= 0)
-               return;
+            goto skip_on_error;
+
        inptr = inputline;
        nextptr = nextline;
        for (j = 0; j < imagewidth; ++j)
@@ -128,6 +133,7 @@ fsdither(TIFF* in, TIFF* out)
                if (TIFFWriteScanline(out, outline, i-1, 0) < 0)
                        break;
        }
+  skip_on_error:
        _TIFFfree(inputline);
        _TIFFfree(thisline);
        _TIFFfree(nextline);
@@ -191,7 +197,6 @@ main(int argc, char* argv[])
        float floatv;
        char thing[1024];
        uint32 rowsperstrip = (uint32) -1;
-       int onestrip = 0;
        uint16 fillorder = 0;
        int c;
        extern int optind;
@@ -213,7 +218,6 @@ main(int argc, char* argv[])
                        break;
                case 'r':               /* rows/strip */
                        rowsperstrip = atoi(optarg);
-                       onestrip = 0;
                        break;
                case 't':
                        threshold = atoi(optarg);
@@ -263,10 +267,7 @@ main(int argc, char* argv[])
        CopyField(TIFFTAG_XRESOLUTION, floatv);
        CopyField(TIFFTAG_YRESOLUTION, floatv);
        CopyField(TIFFTAG_RESOLUTIONUNIT, shortv);
-       if (onestrip)
-               rowsperstrip = imagelength-1;
-       else
-               rowsperstrip = TIFFDefaultStripSize(out, rowsperstrip);
+        rowsperstrip = TIFFDefaultStripSize(out, rowsperstrip);
        TIFFSetField(out, TIFFTAG_ROWSPERSTRIP, rowsperstrip);
        switch (compression) {
        case COMPRESSION_CCITTFAX3:
@@ -323,3 +324,10 @@ usage(void)
 }
 
 /* vim: set ts=8 sts=8 sw=8 noet: */
+/*
+ * Local Variables:
+ * mode: c
+ * c-basic-offset: 8
+ * fill-column: 78
+ * End:
+ */