]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Mon, 26 Jul 2010 12:31:36 +0000 (12:31 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Mon, 26 Jul 2010 12:31:36 +0000 (12:31 +0000)
magick/image.c
wand/mogrify.c

index dcd510e9ff2968b8c60f766e057e8eb8aee7d687..511f540965afe8d9754dc1f2191ab18d03213c43 100644 (file)
@@ -144,6 +144,10 @@ const double
 */
 MagickExport Image *AcquireImage(const ImageInfo *image_info)
 {
+  const char
+    *option,
+    *value;
+
   Image
     *image;
 
@@ -260,6 +264,58 @@ MagickExport Image *AcquireImage(const ImageInfo *image_info)
     ClonePixelCacheMethods(image->cache,image_info->cache);
   (void) SetImageVirtualPixelMethod(image,image_info->virtual_pixel_method);
   (void) SyncImageSettings(image_info,image);
+  option=GetImageOption(image_info,"density");
+  if (option != (const char *) NULL)
+    {
+      GeometryInfo
+        geometry_info;
+
+      /*
+        Set image density.
+      */
+      flags=ParseGeometry(option,&geometry_info);
+      image->x_resolution=geometry_info.rho;
+      image->y_resolution=geometry_info.sigma;
+      if ((flags & SigmaValue) == 0)
+        image->y_resolution=image->x_resolution;
+    }
+  option=GetImageOption(image_info,"delay");
+  if (option != (const char *) NULL)
+    {
+      GeometryInfo
+        geometry_info;
+
+      flags=ParseGeometry(option,&geometry_info);
+      if ((flags & GreaterValue) != 0)
+        {
+          if (image->delay > (size_t) floor(geometry_info.rho+0.5))
+            image->delay=(size_t) floor(geometry_info.rho+0.5);
+        }
+      else
+        if ((flags & LessValue) != 0)
+          {
+            if (image->delay < (size_t) floor(geometry_info.rho+0.5))
+              image->ticks_per_second=(ssize_t) floor(geometry_info.sigma+0.5);
+          }
+        else
+          image->delay=(size_t) floor(geometry_info.rho+0.5);
+      if ((flags & SigmaValue) != 0)
+        image->ticks_per_second=(ssize_t) floor(geometry_info.sigma+0.5);
+    }
+  option=GetImageOption(image_info,"dispose");
+  if (option != (const char *) NULL)
+    image->dispose=(DisposeType) ParseMagickOption(MagickDisposeOptions,
+      MagickFalse,option);
+  option=GetImageOption(image_info,"page");
+  if (option != (const char *) NULL)
+    {
+      char
+        *geometry;
+
+      geometry=GetPageGeometry(option);
+      flags=ParseAbsoluteGeometry(geometry,&image->page);
+      geometry=DestroyString(geometry);
+    }
   return(image);
 }
 \f
@@ -4021,51 +4077,9 @@ MagickExport MagickBooleanType SyncImageSettings(const ImageInfo *image_info,
   if (option != (const char *) NULL)
     image->debug=(MagickBooleanType) ParseMagickOption(MagickBooleanOptions,
       MagickFalse,option);
-  option=GetImageOption(image_info,"delay");
-  if (option != (const char *) NULL)
-    {
-      GeometryInfo
-        geometry_info;
-
-      flags=ParseGeometry(option,&geometry_info);
-      if ((flags & GreaterValue) != 0)
-        {
-          if (image->delay > (size_t) floor(geometry_info.rho+0.5))
-            image->delay=(size_t) floor(geometry_info.rho+0.5);
-        }
-      else
-        if ((flags & LessValue) != 0)
-          {
-            if (image->delay < (size_t) floor(geometry_info.rho+0.5))
-              image->ticks_per_second=(ssize_t) floor(geometry_info.sigma+0.5);
-          }
-        else
-          image->delay=(size_t) floor(geometry_info.rho+0.5);
-      if ((flags & SigmaValue) != 0)
-        image->ticks_per_second=(ssize_t) floor(geometry_info.sigma+0.5);
-    }
-  option=GetImageOption(image_info,"density");
-  if (option != (const char *) NULL)
-    {
-      GeometryInfo
-        geometry_info;
-
-      /*
-        Set image density.
-      */
-      flags=ParseGeometry(option,&geometry_info);
-      image->x_resolution=geometry_info.rho;
-      image->y_resolution=geometry_info.sigma;
-      if ((flags & SigmaValue) == 0)
-        image->y_resolution=image->x_resolution;
-    }
   option=GetImageOption(image_info,"depth");
   if (option != (const char *) NULL)
     image->depth=StringToUnsignedLong(option);
-  option=GetImageOption(image_info,"dispose");
-  if (option != (const char *) NULL)
-    image->dispose=(DisposeType) ParseMagickOption(MagickDisposeOptions,
-      MagickFalse,option);
   option=GetImageOption(image_info,"endian");
   if (option != (const char *) NULL)
     image->endian=(EndianType) ParseMagickOption(MagickEndianOptions,
@@ -4117,16 +4131,6 @@ MagickExport MagickBooleanType SyncImageSettings(const ImageInfo *image_info,
   option=GetImageOption(image_info,"quality");
   if (option != (const char *) NULL)
     image->quality=StringToUnsignedLong(option);
-  option=GetImageOption(image_info,"page");
-  if (option != (const char *) NULL)
-    {
-      char
-        *geometry;
-
-      geometry=GetPageGeometry(option);
-      flags=ParseAbsoluteGeometry(geometry,&image->page);
-      geometry=DestroyString(geometry);
-    }
   option=GetImageOption(image_info,"red-primary");
   if (option != (const char *) NULL)
     {
index d04efec3edf766822554cbc218696042009faf0a..cf3b757a4447d6b1c6022b72771cbb6e70af690d 100644 (file)
@@ -7321,11 +7321,6 @@ WandExport MagickBooleanType MogrifyImageInfo(ImageInfo *image_info,
             SeedPseudoRandomGenerator(seed);
             break;
           }
-        if (LocaleCompare("set",option+1) == 0)
-          {
-            (void) SetImageOption(image_info,argv[i+1],argv[i+2]);
-            break;
-          }
         if (LocaleCompare("size",option+1) == 0)
           {
             if (*option == '+')