X-Git-Url: http://git.imager.perl.org/imager.git/blobdiff_plain/dff75dee0255929e855abe605d59732f7ed392d4..cb024708b25778506bf8d789c8e928216b3c139b:/filters.c diff --git a/filters.c b/filters.c index e801488e..e7d58e3a 100644 --- a/filters.c +++ b/filters.c @@ -649,7 +649,10 @@ i_watermark(i_img *im, i_img *wmark, int tx, int ty, int pixdiff) { int vx, vy, ch; i_color val, wval; - for(vx=0;vx<128;vx++) for(vy=0;vy<110;vy++) { + int mx = wmark->xsize; + int my = wmark->ysize; + + for(vx=0;vxxsize, im2->xsize); - ysize = min(im1->ysize, im2->ysize); + xsize = i_min(im1->xsize, im2->xsize); + ysize = i_min(im1->ysize, im2->ysize); out = i_sametype_chans(im1, xsize, ysize, outchans); @@ -1242,6 +1245,11 @@ i_diff_image(i_img *im1, i_img *im2, int mindiff) { for (y = 0; y < ysize; ++y) { i_glin(im1, 0, xsize, y, line1); i_glin(im2, 0, xsize, y, line2); + if (outchans != diffchans) { + /* give the output an alpha channel since it doesn't have one */ + for (x = 0; x < xsize; ++x) + line2[x].channel[diffchans] = 255; + } for (x = 0; x < xsize; ++x) { int diff = 0; for (ch = 0; ch < diffchans; ++ch) { @@ -1271,6 +1279,11 @@ i_diff_image(i_img *im1, i_img *im2, int mindiff) { for (y = 0; y < ysize; ++y) { i_glinf(im1, 0, xsize, y, line1); i_glinf(im2, 0, xsize, y, line2); + if (outchans != diffchans) { + /* give the output an alpha channel since it doesn't have one */ + for (x = 0; x < xsize; ++x) + line2[x].channel[diffchans] = 1.0; + } for (x = 0; x < xsize; ++x) { int diff = 0; for (ch = 0; ch < diffchans; ++ch) {