]> granicus.if.org Git - imagemagick/blobdiff - MagickCore/montage.c
(no commit message)
[imagemagick] / MagickCore / montage.c
index 6b23d9f7dbe46794272553013ac9b55189b597f9..fa62b433c9884d8e3298cd54d8ae4886b30091a7 100644 (file)
@@ -69,6 +69,7 @@
 #include "MagickCore/resource_.h"
 #include "MagickCore/string_.h"
 #include "MagickCore/utility.h"
+#include "MagickCore/utility-private.h"
 #include "MagickCore/version.h"
 \f
 /*
@@ -386,7 +387,6 @@ MagickExport Image *MontageImageList(const ImageInfo *image_info,
     geometry,
     extract_info;
 
-
   size_t
     bevel_width,
     border_width,
@@ -548,7 +548,7 @@ MagickExport Image *MontageImageList(const ImageInfo *image_info,
   draw_info->stroke=montage_info->stroke;
   draw_info->fill=montage_info->fill;
   draw_info->text=AcquireString("");
-  (void) GetTypeMetrics(image_list[0],draw_info,&metrics);
+  (void) GetTypeMetrics(image_list[0],draw_info,&metrics,exception);
   texture=NewImageList();
   if (montage_info->texture != (char *) NULL)
     {
@@ -559,7 +559,8 @@ MagickExport Image *MontageImageList(const ImageInfo *image_info,
   /*
     Determine the number of lines in an next label.
   */
-  title=InterpretImageProperties(clone_info,image_list[0],montage_info->title);
+  title=InterpretImageProperties(clone_info,image_list[0],montage_info->title,
+    exception);
   title_offset=0;
   if (montage_info->title != (char *) NULL)
     title_offset=(size_t) (2*(metrics.ascent-metrics.descent)*
@@ -576,8 +577,8 @@ MagickExport Image *MontageImageList(const ImageInfo *image_info,
   /*
     Allocate next structure.
   */
-  tile_image=AcquireImage(NULL);
-  montage=AcquireImage(clone_info);
+  tile_image=AcquireImage((ImageInfo *) NULL,exception);
+  montage=AcquireImage(clone_info,exception);
   montage->background_color=montage_info->background_color;
   montage->scene=0;
   images_per_page=(number_images-1)/(tiles_per_row*tiles_per_column)+1;
@@ -635,8 +636,8 @@ MagickExport Image *MontageImageList(const ImageInfo *image_info,
     */
     (void) CopyMagickString(montage->filename,montage_info->filename,
       MaxTextExtent);
-    montage->columns=bounds.width;
-    montage->rows=bounds.height;
+    montage->columns=MagickMax(bounds.width,1);
+    montage->rows=MagickMax(bounds.height,1);
     (void) SetImageBackgroundColor(montage);
     /*
       Set montage geometry.
@@ -696,13 +697,13 @@ MagickExport Image *MontageImageList(const ImageInfo *image_info,
         clone_info=CloneDrawInfo(image_info,draw_info);
         clone_info->gravity=CenterGravity;
         clone_info->pointsize*=2.0;
-        (void) GetTypeMetrics(image_list[0],clone_info,&metrics);
+        (void) GetTypeMetrics(image_list[0],clone_info,&metrics,exception);
         (void) FormatLocaleString(geometry,MaxTextExtent,
           "%.20gx%.20g%+.20g%+.20g",(double) montage->columns,(double)
           (metrics.ascent-metrics.descent),0.0,(double) extract_info.y+4);
         (void) CloneString(&clone_info->geometry,geometry);
         (void) CloneString(&clone_info->text,title);
-        (void) AnnotateImage(montage,clone_info);
+        (void) AnnotateImage(montage,clone_info,exception);
         clone_info=DestroyDrawInfo(clone_info);
       }
     (void) SetImageProgressMonitor(montage,progress_monitor,
@@ -749,7 +750,7 @@ MagickExport Image *MontageImageList(const ImageInfo *image_info,
               border_info.width=(width-image->columns+1)/2;
               border_info.height=(height-image->rows+1)/2;
             }
-          border_image=BorderImage(image,&border_info,exception);
+          border_image=BorderImage(image,&border_info,image->compose,exception);
           if (border_image != (Image *) NULL)
             {
               image=DestroyImage(image);
@@ -758,9 +759,9 @@ MagickExport Image *MontageImageList(const ImageInfo *image_info,
           if ((montage_info->frame != (char *) NULL) &&
               (image->compose == DstOutCompositeOp))
             {
-              SetPixelComponentMap(image,AlphaChannel);
-              (void) NegateImage(image,MagickFalse);
-              SetPixelComponentMap(image,DefaultChannels);
+              SetPixelChannelMap(image,AlphaChannel);
+              (void) NegateImage(image,MagickFalse,exception);
+              SetPixelChannelMap(image,DefaultChannels);
             }
         }
       /*
@@ -794,7 +795,7 @@ MagickExport Image *MontageImageList(const ImageInfo *image_info,
           if (value != (const char *) NULL)
             extract_info.height+=(size_t) ((metrics.ascent-
               metrics.descent+4)*MultilineCensus(value));
-          frame_image=FrameImage(image,&extract_info,exception);
+          frame_image=FrameImage(image,&extract_info,image->compose,exception);
           if (frame_image != (Image *) NULL)
             {
               image=DestroyImage(image);
@@ -816,8 +817,8 @@ MagickExport Image *MontageImageList(const ImageInfo *image_info,
               /*
                 Shadow image.
               */
-              (void) QueryColorDatabase("#00000000",&image->background_color,
-                exception);
+              (void) QueryColorCompliance("#00000000",AllCompliance,
+                &image->background_color,exception);
               shadow_image=ShadowImage(image,80.0,2.0,5,5,exception);
               if (shadow_image != (Image *) NULL)
                 {
@@ -848,7 +849,7 @@ MagickExport Image *MontageImageList(const ImageInfo *image_info,
                 (montage_info->shadow != MagickFalse ? 4 : 0))+bevel_width));
               (void) CloneString(&draw_info->geometry,geometry);
               (void) CloneString(&draw_info->text,value);
-              (void) AnnotateImage(montage,draw_info);
+              (void) AnnotateImage(montage,draw_info,exception);
             }
         }
       x_offset+=(ssize_t) (width+2*(extract_info.x+border_width));
@@ -880,7 +881,7 @@ MagickExport Image *MontageImageList(const ImageInfo *image_info,
         /*
           Allocate next image structure.
         */
-        AcquireNextImage(clone_info,montage);
+        AcquireNextImage(clone_info,montage,exception);
         if (GetNextImageInList(montage) == (Image *) NULL)
           {
             montage=DestroyImageList(montage);