]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Thu, 7 Feb 2013 01:24:54 +0000 (01:24 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Thu, 7 Feb 2013 01:24:54 +0000 (01:24 +0000)
MagickWand/operation.c
coders/caption.c
coders/pango.c

index fb769fe724f59a05da703f7c3c1186f27c2327be..17db95c12128cb7d682d4ca1e99d7f9c3cdf97f6 100644 (file)
@@ -1768,7 +1768,7 @@ static void CLISimpleOperatorImage(MagickCLI *cli_wand,
 
           SetGeometryInfo(&geometry_info);
           flags=ParseGeometry(arg1,&geometry_info);
-          if ((flags & RhoValue) == 0)
+          if (flags == 0)
             CLIWandExceptArgBreak(OptionError,"InvalidArgument",option,arg1);
           if ((flags & SigmaValue) == 0)
             geometry_info.sigma=geometry_info.rho;
index 7a3443fa9d414c32577b14aae3e48b7d7bf744a1..8574aaf3320fed6862fcb56791abbb8c10ddb3a4 100644 (file)
@@ -168,7 +168,7 @@ static Image *ReadCAPTIONImage(const ImageInfo *image_info,
       /*
         Auto fit text into bounding box.
       */
-      for ( ; ; )
+      for ( ; ; draw_info->pointsize*=2.0)
       {
         text=AcquireString(caption);
         i=FormatMagickCaption(image,draw_info,MagickTrue,&metrics,&text,
@@ -185,11 +185,9 @@ static Image *ReadCAPTIONImage(const ImageInfo *image_info,
         height=(size_t) floor(metrics.height+draw_info->stroke_width+0.5);
         if ((width > image->columns) && (height > image->rows))
           break;
-        draw_info->pointsize*=2.0;
       }
       high=draw_info->pointsize/2.0;
-      low=high/2.0;
-      while ((high-low) > 1.0)
+      for (low=high/2.0; (high-low) > 1.0; )
       {
         draw_info->pointsize=(low+high)/2.0;
         text=AcquireString(caption);
@@ -209,7 +207,7 @@ static Image *ReadCAPTIONImage(const ImageInfo *image_info,
         else
           high=draw_info->pointsize-1.0;
       }
-      for (draw_info->pointsize=(low+high)/2.0; (high-low) > 1.0; )
+      for (draw_info->pointsize=(low+high)/2.0; ; draw_info->pointsize--)
       {
         text=AcquireString(caption);
         i=FormatMagickCaption(image,draw_info,MagickTrue,&metrics,&text,
@@ -225,7 +223,6 @@ static Image *ReadCAPTIONImage(const ImageInfo *image_info,
         height=(size_t) floor(metrics.height+draw_info->stroke_width+0.5);
         if ((width <= image->columns) && (height <= image->rows))
           break;
-        draw_info->pointsize--;
       }
       draw_info->pointsize=floor(draw_info->pointsize);
     }
index 1018e9cf241bf273fdae706d44a29be0451028aa..e4e1cb237c7241ef7d52dc8fb389d198ef65cbd2 100644 (file)
@@ -350,7 +350,7 @@ static Image *ReadPANGOImage(const ImageInfo *image_info,
     (void) ParseAbsoluteGeometry(image_info->page,&page);
   if (image->columns == 0)
     {
-      pango_layout_get_pixel_extents(layout,NULL,&extent);
+      pango_layout_get_extents(layout,NULL,&extent);
       image->columns=(extent.x+extent.width+PANGO_SCALE/2)/PANGO_SCALE+2*page.x;
     }
   else
@@ -362,7 +362,7 @@ static Image *ReadPANGOImage(const ImageInfo *image_info,
     }
   if (image->rows == 0)
     {
-      pango_layout_get_pixel_extents(layout,NULL,&extent);
+      pango_layout_get_extents(layout,NULL,&extent);
       image->rows=(extent.y+extent.height+PANGO_SCALE/2)/PANGO_SCALE+2*page.y;
     }
   else