diff options
author | Vincent Sanders <vince@kyllikki.org> | 2018-01-08 23:09:23 +0000 |
---|---|---|
committer | Vincent Sanders <vince@kyllikki.org> | 2018-01-08 23:09:23 +0000 |
commit | b668680da5aa0930820df70f1b182243a7a8cde4 (patch) | |
tree | a45cb44b96341971ee1e7ace312bcec284f1dd72 /src/cos_parse.c | |
parent | 615323e574ffcecd8525711c39beffcac4156624 (diff) | |
download | libnspdf-b668680da5aa0930820df70f1b182243a7a8cde4.tar.gz libnspdf-b668680da5aa0930820df70f1b182243a7a8cde4.tar.bz2 |
split out stream filtering
Diffstat (limited to 'src/cos_parse.c')
-rw-r--r-- | src/cos_parse.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/cos_parse.c b/src/cos_parse.c index 5448ad4..de85b0c 100644 --- a/src/cos_parse.c +++ b/src/cos_parse.c @@ -27,6 +27,7 @@ /** Maximum length of cos name */ #define NAME_MAX_LENGTH 127 + static nspdferror cos_string_append(struct cos_string *s, uint8_t c) { @@ -717,8 +718,16 @@ cos_parse_stream(struct nspdf_doc *doc, /* optional filter */ res = cos_get_dictionary_value(doc, stream_dict, "Filter", &stream_filter); if (res == NSPDFERROR_OK) { - /** \todo filter stream */ - printf("applying filter %s\n", stream_filter->u.n); + const char *filter_name; + res = cos_get_name(doc, stream_filter, &filter_name); + if (res == NSPDFERROR_OK) { + res = nspdf__cos_stream_filter(doc, filter_name, &stream); + if (res != NSPDFERROR_OK) { + return res; + } + } else { + /** \todo array of filter stream */ + } } /* allocate stream object */ |