summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
Diffstat (limited to 'source')
-rw-r--r--source/fitz/colorspace.c7
-rw-r--r--source/fitz/draw-affine.c2
-rw-r--r--source/fitz/draw-device.c2
3 files changed, 7 insertions, 4 deletions
diff --git a/source/fitz/colorspace.c b/source/fitz/colorspace.c
index 7923446a..298c4712 100644
--- a/source/fitz/colorspace.c
+++ b/source/fitz/colorspace.c
@@ -1633,9 +1633,12 @@ fz_convert_pixmap(fz_context *ctx, fz_pixmap *dp, fz_pixmap *sp)
fz_colorspace *ss = sp->colorspace;
fz_colorspace *ds = dp->colorspace;
- if (ds == NULL && sp->alpha)
+ if (ds == NULL)
{
- fast_copy_alpha(dp, sp);
+ if (sp->alpha)
+ fast_copy_alpha(dp, sp);
+ else
+ fz_clear_pixmap_with_value(ctx, dp, 255);
return;
}
diff --git a/source/fitz/draw-affine.c b/source/fitz/draw-affine.c
index 70e05121..38679d6e 100644
--- a/source/fitz/draw-affine.c
+++ b/source/fitz/draw-affine.c
@@ -1365,7 +1365,7 @@ fz_paint_image_imp(fz_pixmap * restrict dst, const fz_irect *scissor, const fz_p
/* Sometimes we can get an alpha only input to be
* ploted. In this case treat it as a greyscale
* input. */
- if (img->n == sa && n > 0)
+ if (img->n == sa && color)
sa = 0;
if (n == 3 && img->n == 1 + sa && !color)
diff --git a/source/fitz/draw-device.c b/source/fitz/draw-device.c
index 516e05bc..88e117c7 100644
--- a/source/fitz/draw-device.c
+++ b/source/fitz/draw-device.c
@@ -1227,7 +1227,7 @@ fz_draw_fill_image(fz_context *ctx, fz_device *devp, fz_image *image, const fz_m
{
fz_irect bbox;
fz_pixmap_bbox(ctx, pixmap, &bbox);
- converted = fz_new_pixmap_with_bbox(ctx, model, &bbox, pixmap->alpha);
+ converted = fz_new_pixmap_with_bbox(ctx, model, &bbox, (model ? pixmap->alpha : 1));
fz_convert_pixmap(ctx, converted, pixmap);
pixmap = converted;
}