diff options
-rw-r--r-- | include/mupdf/fitz/separation.h | 7 | ||||
-rw-r--r-- | source/fitz/separation.c | 7 |
2 files changed, 10 insertions, 4 deletions
diff --git a/include/mupdf/fitz/separation.h b/include/mupdf/fitz/separation.h index 9bbb1845..aa66b3ba 100644 --- a/include/mupdf/fitz/separation.h +++ b/include/mupdf/fitz/separation.h @@ -67,8 +67,11 @@ int fz_separations_controllable(fz_context *ctx, const fz_separations *seps); /* Return the number of active separations. */ int fz_count_active_separations(fz_context *ctx, const fz_separations *seps); -/* If the separations selection is unsuitable for overprint, - * clone it to produce one that is, otherwise return NULL. */ +/* Return a separations object with all the spots in the input + * separations object that are set to composite, reset to be + * enabled. If there ARE no spots in the object, this returns + * NULL. If the object already has all its spots enabled, then + * just returns another handle on the same object. */ fz_separations *fz_clone_separations_for_overprint(fz_context *ctx, fz_separations *seps); /* Convert a color given in terms of one colorspace, diff --git a/source/fitz/separation.c b/source/fitz/separation.c index 5f8fee41..f4f5e262 100644 --- a/source/fitz/separation.c +++ b/source/fitz/separation.c @@ -195,6 +195,8 @@ fz_separations *fz_clone_separations_for_overprint(fz_context *ctx, fz_separatio return NULL; n = sep->num_separations; + if (n == 0) + return NULL; c = 0; for (i = 0; i < n; i++) { @@ -203,9 +205,10 @@ fz_separations *fz_clone_separations_for_overprint(fz_context *ctx, fz_separatio c++; } - /* If no composites, then we are fine to render direct. */ + /* If no composites, then we don't need to create a new seps object + * with the composite ones enabled, so just reuse our current object. */ if (c == 0) - return NULL; + return fz_keep_separations(ctx, sep); /* We need to clone us a separation structure, with all * the composite separations marked as enabled. */ |