summaryrefslogtreecommitdiff
path: root/source/pdf
diff options
context:
space:
mode:
authorSebastian Rasmussen <sebras@gmail.com>2017-08-13 00:57:31 +0800
committerSebastian Rasmussen <sebras@gmail.com>2017-08-16 19:41:54 +0800
commit33564e95a1834b8e58a0f445363808dfb3b625d4 (patch)
treefe57df653bf0b4160313de36b4d5381fcb89cc6e /source/pdf
parentdc5dc49ca1be9dcb6db3e951dfb6824cb97139e8 (diff)
downloadmupdf-33564e95a1834b8e58a0f445363808dfb3b625d4.tar.xz
Add bits per component parameter for flate and lzw compressed images.
Diffstat (limited to 'source/pdf')
-rw-r--r--source/pdf/pdf-image.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/source/pdf/pdf-image.c b/source/pdf/pdf-image.c
index 6afc804f..45273cfb 100644
--- a/source/pdf/pdf-image.c
+++ b/source/pdf/pdf-image.c
@@ -364,6 +364,8 @@ pdf_add_image(fz_context *ctx, pdf_document *doc, fz_image *image, int mask)
pdf_dict_put_drop(ctx, dp, PDF_NAME_Colors, pdf_new_int(ctx, doc, cp->u.flate.colors));
if (cp->u.flate.predictor)
pdf_dict_put_drop(ctx, dp, PDF_NAME_Predictor, pdf_new_int(ctx, doc, cp->u.flate.predictor));
+ if (cp->u.flate.bpc)
+ pdf_dict_put_drop(ctx, dp, PDF_NAME_BitsPerComponent, pdf_new_int(ctx, doc, cp->u.flate.bpc));
pdf_dict_put_drop(ctx, imobj, PDF_NAME_Filter, PDF_NAME_FlateDecode);
pdf_dict_put_drop(ctx, imobj, PDF_NAME_BitsPerComponent, pdf_new_int(ctx, doc, image->bpc));
break;
@@ -376,6 +378,8 @@ pdf_add_image(fz_context *ctx, pdf_document *doc, fz_image *image, int mask)
pdf_dict_put_drop(ctx, dp, PDF_NAME_Predictor, pdf_new_int(ctx, doc, cp->u.lzw.predictor));
if (cp->u.lzw.early_change)
pdf_dict_put_drop(ctx, dp, PDF_NAME_EarlyChange, pdf_new_int(ctx, doc, cp->u.lzw.early_change));
+ if (cp->u.lzw.bpc)
+ pdf_dict_put_drop(ctx, dp, PDF_NAME_BitsPerComponent, pdf_new_int(ctx, doc, cp->u.lzw.bpc));
pdf_dict_put_drop(ctx, imobj, PDF_NAME_Filter, PDF_NAME_LZWDecode);
break;
case FZ_IMAGE_RLD: