*/
MagickExport Image *AcquireImage(const ImageInfo *image_info)
{
+ const char
+ *option,
+ *value;
+
Image
*image;
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
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,
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)
{