Allow "compound" filters that consist of a single named filter (Issue #47)

This commit is contained in:
Michael R Sweet
2023-10-10 07:14:12 -04:00
parent 7e3db6b639
commit 2e91e05d7b
2 changed files with 12 additions and 1 deletions

View File

@@ -464,11 +464,18 @@ _pdfioStreamOpen(pdfio_obj_t *obj, // I - Object
// Try to decode/decompress the contents of this object...
const char *filter = pdfioDictGetName(dict, "Filter");
// Filter value
pdfio_array_t *fa; // Filter array
if (!filter && (fa = pdfioDictGetArray(dict, "Filter")) != NULL && pdfioArrayGetSize(fa) == 1)
{
// Support single-valued arrays...
filter = pdfioArrayGetName(fa, 0);
}
if (!filter)
{
// No single filter name, do we have a compound filter?
if (pdfioDictGetArray(dict, "Filter"))
if (fa)
{
// TODO: Implement compound filters...
_pdfioFileError(st->pdf, "Unsupported compound stream filter.");