From: cristy Date: Thu, 18 Mar 2010 01:19:38 +0000 (+0000) Subject: (no commit message) X-Git-Tag: 7.0.1-0~9781 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0534a6be52415cd2b88995a1d7fbe554768e3e20;p=imagemagick --- diff --git a/PerlMagick/Magick.xs b/PerlMagick/Magick.xs index 22b214c99..c7ab9c1dd 100644 --- a/PerlMagick/Magick.xs +++ b/PerlMagick/Magick.xs @@ -1311,9 +1311,10 @@ static void SetAttribute(pTHX_ struct PackageInfo *info,Image *image, flags=ParseGeometry(SvPV(sval,na),&geometry_info); for ( ; image; image=image->next) { - image->delay=(unsigned long) (geometry_info.rho+0.5); + image->delay=(unsigned long) floor(geometry_info.rho+0.5); if ((flags & SigmaValue) != 0) - image->ticks_per_second=(unsigned long) (geometry_info.sigma+0.5); + image->ticks_per_second=(unsigned long) + floor(geometry_info.sigma+0.5); } break; } @@ -9618,8 +9619,8 @@ Mogrify(ref,...) if (attribute_flag[4] != 0) geometry_info.psi=argument_list[4].long_reference; image=ShadowImage(image,geometry_info.rho,geometry_info.sigma, - (long) (geometry_info.xi+0.5),(long) (geometry_info.psi+0.5), - exception); + (long) ceil(geometry_info.xi-0.5),(long) ceil(geometry_info.psi- + 0.5),exception); break; } case 90: /* Identify */ @@ -9732,8 +9733,8 @@ Mogrify(ref,...) (void) QueryColorDatabase(argument_list[5].string_reference, &image->background_color,exception); image=VignetteImage(image,geometry_info.rho,geometry_info.sigma, - (long) (geometry_info.xi+0.5),(long) (geometry_info.psi+0.5), - exception); + (long) ceil(geometry_info.xi-0.5),(long) ceil(geometry_info.psi- + 0.5),exception); break; } case 95: /* ContrastStretch */ @@ -11514,13 +11515,13 @@ QueryColor(ref,...) PUSHs(&sv_undef); continue; } - PUSHs(sv_2mortal(newSViv((unsigned long) (color.red+0.5)))); - PUSHs(sv_2mortal(newSViv((unsigned long) (color.green+0.5)))); - PUSHs(sv_2mortal(newSViv((unsigned long) (color.blue+0.5)))); + PUSHs(sv_2mortal(newSViv((unsigned long) floor(color.red+0.5)))); + PUSHs(sv_2mortal(newSViv((unsigned long) floor(color.green+0.5)))); + PUSHs(sv_2mortal(newSViv((unsigned long) floor(color.blue+0.5)))); if (color.matte != MagickFalse) - PUSHs(sv_2mortal(newSViv((unsigned long) (color.opacity+0.5)))); + PUSHs(sv_2mortal(newSViv((unsigned long) floor(color.opacity+0.5)))); if (color.colorspace == CMYKColorspace) - PUSHs(sv_2mortal(newSViv((unsigned long) (color.index+0.5)))); + PUSHs(sv_2mortal(newSViv((unsigned long) floor(color.index+0.5)))); } PerlException: diff --git a/coders/jpeg.c b/coders/jpeg.c index 460c33c3f..0972f8687 100644 --- a/coders/jpeg.c +++ b/coders/jpeg.c @@ -1778,8 +1778,8 @@ static MagickBooleanType WriteJPEGImage(const ImageInfo *image_info, jpeg_info.density_unit=(UINT8) 1; if (image->debug != MagickFalse) (void) LogMagickEvent(CoderEvent,GetMagickModule(), - "Image resolution: %ld,%ld",(long) ceil(image->x_resolution-0.5), - (long) ceil(image->y_resolution-0.5)); + "Image resolution: %ld,%ld",(long) floor(image->x_resolution+0.5), + (long) floor(image->y_resolution+0.5)); if ((image->x_resolution != 0.0) && (image->y_resolution != 0.0)) { /* diff --git a/coders/msl.c b/coders/msl.c index aa015092a..239d4f81d 100644 --- a/coders/msl.c +++ b/coders/msl.c @@ -6248,8 +6248,8 @@ static void MSLStartElement(void *context,const xmlChar *tag, } } shadow_image=ShadowImage(msl_info->image[n],geometry_info.rho, - geometry_info.sigma,(long) floor(geometry_info.xi+0.5),(long) - floor(geometry_info.psi+0.5),&msl_info->image[n]->exception); + geometry_info.sigma,(long) ceil(geometry_info.xi-0.5),(long) + ceil(geometry_info.psi-0.5),&msl_info->image[n]->exception); if (shadow_image == (Image *) NULL) break; msl_info->image[n]=DestroyImage(msl_info->image[n]); diff --git a/wand/mogrify.c b/wand/mogrify.c index 2275532f1..cbbfc5700 100644 --- a/wand/mogrify.c +++ b/wand/mogrify.c @@ -2993,8 +2993,8 @@ WandExport MagickBooleanType MogrifyImage(ImageInfo *image_info,const int argc, if ((flags & PsiValue) == 0) geometry_info.psi=4.0; shadow_image=ShadowImage(*image,geometry_info.rho, - geometry_info.sigma,(long) floor(geometry_info.xi+0.5),(long) - floor(geometry_info.psi+0.5),exception); + geometry_info.sigma,(long) ceil(geometry_info.xi-0.5),(long) + ceil(geometry_info.psi-0.5),exception); if (shadow_image == (Image *) NULL) break; *image=DestroyImage(*image); @@ -3499,8 +3499,8 @@ WandExport MagickBooleanType MogrifyImage(ImageInfo *image_info,const int argc, if ((flags & PsiValue) == 0) geometry_info.psi=0.1*(*image)->rows; vignette_image=VignetteImage(*image,geometry_info.rho, - geometry_info.sigma,(long) floor(geometry_info.xi+0.5),(long) - floor(geometry_info.psi+0.5),exception); + geometry_info.sigma,(long) ceil(geometry_info.xi-0.5),(long) + ceil(geometry_info.psi-0.5),exception); if (vignette_image == (Image *) NULL) break; *image=DestroyImage(*image);