summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2018-11-13 13:27:30 +0100
committerTor Andersson <tor.andersson@artifex.com>2018-11-13 21:27:06 +0100
commitb35df4b2ae4a80c8f770335b813e5cd3203c175b (patch)
tree9ed6b381d3aa039cfb94613b9b7162cb49602520 /source
parent9a8a3fe5e1d3e319559fd0bde2bc40bc47ee01bd (diff)
downloadmupdf-b35df4b2ae4a80c8f770335b813e5cd3203c175b.tar.xz
Use fz_image.imagemask field when adding PDF image resources.
Don't pass the information as a separate argument.
Diffstat (limited to 'source')
-rw-r--r--source/pdf/pdf-device.c4
-rw-r--r--source/pdf/pdf-image.c6
-rw-r--r--source/tools/murun.c2
-rw-r--r--source/tools/pdfcreate.c2
4 files changed, 7 insertions, 7 deletions
diff --git a/source/pdf/pdf-device.c b/source/pdf/pdf-device.c
index 7322bd32..a193f565 100644
--- a/source/pdf/pdf-device.c
+++ b/source/pdf/pdf-device.c
@@ -819,7 +819,7 @@ pdf_dev_fill_image(fz_context *ctx, fz_device *dev, fz_image *image, fz_matrix c
gstate *gs = CURRENT_GSTATE(pdev);
pdf_dev_end_text(ctx, pdev);
- im_res = pdf_add_image(ctx, pdev->doc, image, 0);
+ im_res = pdf_add_image(ctx, pdev->doc, image);
if (im_res == NULL)
{
fz_warn(ctx, "pdf_add_image: problem adding image resource");
@@ -856,7 +856,7 @@ pdf_dev_fill_image_mask(fz_context *ctx, fz_device *dev, fz_image *image, fz_mat
gstate *gs = CURRENT_GSTATE(pdev);
pdf_dev_end_text(ctx, pdev);
- im_res = pdf_add_image(ctx, pdev->doc, image, 1);
+ im_res = pdf_add_image(ctx, pdev->doc, image);
if (im_res == NULL)
{
fz_warn(ctx, "pdf_add_image: problem adding image resource");
diff --git a/source/pdf/pdf-image.c b/source/pdf/pdf-image.c
index da98cce8..939c8974 100644
--- a/source/pdf/pdf-image.c
+++ b/source/pdf/pdf-image.c
@@ -299,7 +299,7 @@ pdf_load_image(fz_context *ctx, pdf_document *doc, pdf_obj *dict)
}
pdf_obj *
-pdf_add_image(fz_context *ctx, pdf_document *doc, fz_image *image, int mask)
+pdf_add_image(fz_context *ctx, pdf_document *doc, fz_image *image)
{
fz_pixmap *pixmap = NULL;
pdf_obj *imobj = NULL;
@@ -457,7 +457,7 @@ raw_or_unknown_compression:
pdf_dict_put_int(ctx, imobj, PDF_NAME(Width), pixmap ? pixmap->w : image->w);
pdf_dict_put_int(ctx, imobj, PDF_NAME(Height), pixmap ? pixmap->h : image->h);
- if (mask)
+ if (image->imagemask)
{
pdf_dict_put_bool(ctx, imobj, PDF_NAME(ImageMask), 1);
}
@@ -525,7 +525,7 @@ raw_or_unknown_compression:
if (image->mask)
{
- pdf_dict_put_drop(ctx, imobj, PDF_NAME(SMask), pdf_add_image(ctx, doc, image->mask, 1));
+ pdf_dict_put_drop(ctx, imobj, PDF_NAME(SMask), pdf_add_image(ctx, doc, image->mask));
}
pdf_update_stream(ctx, doc, imobj, buffer, 1);
diff --git a/source/tools/murun.c b/source/tools/murun.c
index 33bdd8f4..d122ce51 100644
--- a/source/tools/murun.c
+++ b/source/tools/murun.c
@@ -3283,7 +3283,7 @@ static void ffi_PDFDocument_addImage(js_State *J)
pdf_obj *ind = NULL;
fz_try(ctx)
- ind = pdf_add_image(ctx, pdf, image, 0);
+ ind = pdf_add_image(ctx, pdf, image);
fz_catch(ctx)
rethrow(J);
diff --git a/source/tools/pdfcreate.c b/source/tools/pdfcreate.c
index 043936e4..b0f1c0a3 100644
--- a/source/tools/pdfcreate.c
+++ b/source/tools/pdfcreate.c
@@ -120,7 +120,7 @@ static void add_image_res(pdf_obj *resources, char *name, char *path)
pdf_dict_put_drop(ctx, resources, PDF_NAME(XObject), subres);
}
- ref = pdf_add_image(ctx, doc, image, 0);
+ ref = pdf_add_image(ctx, doc, image);
pdf_dict_puts(ctx, subres, name, ref);
pdf_drop_obj(ctx, ref);