summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohannes Hofmann <Johannes.Hofmann@gmx.de>2006-08-03 21:12:39 +0200
committerJohannes Hofmann <Johannes.Hofmann@gmx.de>2006-08-03 21:12:39 +0200
commitf3575d9ccfc61beca36ef40dc20b625cbc2f1368 (patch)
tree376773e23af341febac2ec280cae9074fd8b2d50 /src
parentb289453edc8c3f83824b2e2964779de0bad148a7 (diff)
use TIFFWriteEncodedStrip instead of TIFFWriteScanline because of mem
usage of libtiff.
Diffstat (limited to 'src')
-rw-r--r--src/TIFFOutputImage.cxx8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/TIFFOutputImage.cxx b/src/TIFFOutputImage.cxx
index ed9213f..b8433ca 100644
--- a/src/TIFFOutputImage.cxx
+++ b/src/TIFFOutputImage.cxx
@@ -66,6 +66,7 @@ TIFFOutputImage::init_internal(int w1, int h1) {
TIFFSetField(tiff, TIFFTAG_COMPRESSION, COMPRESSION_DEFLATE);
TIFFSetField(tiff, TIFFTAG_PLANARCONFIG, PLANARCONFIG_CONTIG);
TIFFSetField(tiff, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_RGB);
+ TIFFSetField(tiff, TIFFTAG_ROWSPERSTRIP, 1);
TIFFSetField(tiff, TIFFTAG_BITSPERSAMPLE, 8);
TIFFSetField(tiff, TIFFTAG_SAMPLESPERPIXEL, 4);
@@ -85,10 +86,9 @@ TIFFOutputImage::set_pixel_internal(int x, char r, char g, char b) {
int
TIFFOutputImage::next_line_internal() {
int ret;
- ret = TIFFWriteScanline(tiff, row, line-1, 0);
- if (ret != 1) {
- fprintf(stderr, "TIFFWriteScanline failed\n");
- }
+
+ TIFFWriteEncodedStrip(tiff, line -1 , row, W * 4);
+
memset(row, 0, sizeof(char) * 4 * W);
return 0;
}