]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Thu, 18 Mar 2010 01:19:38 +0000 (01:19 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Thu, 18 Mar 2010 01:19:38 +0000 (01:19 +0000)
PerlMagick/Magick.xs
coders/jpeg.c
coders/msl.c
wand/mogrify.c

index 22b214c99f5eb87b4951ff566b31f7c8857db800..c7ab9c1ddf0f753ab624f055f29cd1cec0786ad2 100644 (file)
@@ -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:
index 460c33c3f6baef920a97626c71ed4c9fb5eee13d..0972f86877d177479f8476ddb28e8f907f97b995 100644 (file)
@@ -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))
     {
       /*
index aa015092a916611e151d929f0e8e5a206ef60a73..239d4f81d65c1aebc2a3b60282023632ed7f0b40 100644 (file)
@@ -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]);
index 2275532f18e8548eab4a925845cc4f0ef0e3f5f0..cbbfc5700c01ea460b47c093f523d032215e9cf9 100644 (file)
@@ -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);