]> gitweb.hhaalo.de Git - sane-kds-s2000w-net.git/commitdiff
change tiff direct method bw pnm
authorBastian Dehn <hhaalo@arcor.de>
Thu, 30 Jan 2025 19:21:06 +0000 (20:21 +0100)
committerBastian Dehn <hhaalo@arcor.de>
Thu, 30 Jan 2025 19:21:06 +0000 (20:21 +0100)
src/kds_s2000w_image_converter_netpbm.c

index 6067801c21381ea9ba69d70610ac5d3a25435188..e362195eaf3db4bf5e064cb4a0cb2d6c2ab288c0 100644 (file)
@@ -21,6 +21,7 @@ tsize_t _kds_s2000w_image_converter_tiff_read(thandle_t handler, tdata_t data, t
 {
        return fread(data, sizeof(char), size, handler);
 }
+
 tsize_t _kds_s2000w_image_converter_tiff_write(thandle_t handler, tdata_t data, tsize_t size)
 {
        return fwrite(data, sizeof(char), size, handler);
@@ -180,15 +181,6 @@ void _kds_s2000w_image_converter_write_pnm(unsigned char* data,
 {
        kds_s2000w_debug_printf(ALL, "kds_s2000w_image_converter_write_pnm");
 
-       if (format == BW) {
-               _kds_s2000w_image_converter_write_bw_pnm(data,
-                       size,
-                       width,
-                       height,
-                       pnm_stream);
-               return;
-       }
-
        xel** pixels = malloc(sizeof(xel*) * height);
        for (int i = 0; i < height; i++) {
                pixels[i] = malloc(sizeof(xel) * width);
@@ -349,11 +341,10 @@ void kds_s2000w_image_converter_tiff_to_pnm(blobdata* in, blobdata* out)
 
        char** outdata = malloc(sizeof(char*));
        FILE* pnm_stream = open_memstream(outdata, &out->size);
-       _kds_s2000w_image_converter_write_pnm(decompress_data,
+       _kds_s2000w_image_converter_write_bw_pnm(decompress_data,
                decompress_size,
                width,
                height,
-               BW,
                pnm_stream);
        fclose(pnm_stream);
        pnm_stream = NULL;