summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor@ghostscript.com>2005-05-24 06:19:10 +0200
committerTor Andersson <tor@ghostscript.com>2005-05-24 06:19:10 +0200
commit04334c84b883840ec8bbe62d48e57df5f6408ca7 (patch)
tree339bfa31c4a7b48d4eed8701fd528650a186f2a6
parentd759c948debd9e2dd79eb220b10682681c446e3e (diff)
downloadmupdf-04334c84b883840ec8bbe62d48e57df5f6408ca7.tar.xz
tiff and stream cleanups
-rw-r--r--Jamfile3
-rw-r--r--samus/sa_tiff.c15
-rw-r--r--stream/stm_filter.c (renamed from stream/filt_process.c)0
3 files changed, 5 insertions, 13 deletions
diff --git a/Jamfile b/Jamfile
index a48860e8..f50ad08a 100644
--- a/Jamfile
+++ b/Jamfile
@@ -134,14 +134,13 @@ Library libstream :
obj_print.c
obj_simple.c
+ stm_filter.c
stm_buffer.c
stm_filec.c
stm_filer.c
stm_filew.c
- filt_process.c
filt_pipeline.c
-
filt_a85d.c
filt_a85e.c
filt_ahxd.c
diff --git a/samus/sa_tiff.c b/samus/sa_tiff.c
index 232da32f..3530f944 100644
--- a/samus/sa_tiff.c
+++ b/samus/sa_tiff.c
@@ -1,6 +1,6 @@
/*
- * Minimal TIFF image loader. Baseline TIFF 6.0 with a few extensions,
- * as specified in the Metro specification.
+ * Minimal TIFF image loader. Baseline TIFF 6.0 with CMYK support.
+ * Limited bit depth and extra samples support, as per Metro.
*/
#include "fitz.h"
@@ -101,7 +101,6 @@ static const unsigned char bitrev[256] =
0x1f, 0x9f, 0x5f, 0xdf, 0x3f, 0xbf, 0x7f, 0xff
};
-
static inline unsigned readshort(sa_tiff *tiff)
{
unsigned a = fz_readbyte(tiff->file);
@@ -234,15 +233,8 @@ printf("w=%d h=%d n=%d bpc=%d ",
case 2:
printf("CCITT ");
- if (tiff->photometric != 0 && tiff->photometric != 1)
- return fz_throw("ioerror: ccitt encoding on color TIFF");
- if (tiff->samplesperpixel != 1)
- return fz_throw("ioerror: ccitt encoding on multi-component TIFF");
- if (tiff->bitspersample != 1)
- return fz_throw("ioerror: ccitt encoding on multi-bit TIFF");
-
error = fz_packobj(&params, "<<"
- "/K 1 /EncodedByteAlign true /EndOfLine false /EndOfBlock false"
+ "/K 0 /EncodedByteAlign true /EndOfLine false /EndOfBlock false"
"/Columns %i /Rows %i /BlackIs1 %b"
">>",
tiff->imagewidth,
@@ -270,6 +262,7 @@ printf("w=%d h=%d n=%d bpc=%d ",
printf("\n");
+ /* TODO: scrap write-file and decode with filter directly to final destination */
error = fz_newbuffer(&buf, 4096);
error = fz_openbuffer(&file, buf, FZ_WRITE);
diff --git a/stream/filt_process.c b/stream/stm_filter.c
index afe4feed..afe4feed 100644
--- a/stream/filt_process.c
+++ b/stream/stm_filter.c