*name='\0';
sub_number=1;
if (*name == '#')
- sub_number=StringToLong(&name[1]);
+ sub_number=(ssize_t) StringToLong(&name[1]);
sub_number=MagickMax(sub_number,1L);
resource=(char *) NULL;
status=MagickFalse;
image->properties);
return(p);
}
- if ((image->properties != (void *) NULL) &&
- (LocaleNCompare("fx:",property,3) != 0))
+ if (image->properties != (void *) NULL)
{
p=(const char *) GetValueFromSplayTree((SplayTreeInfo *)
image->properties,property);
case 'F':
case 'f':
{
- if ((LocaleNCompare("fx:",property,3) == 0) ||
- (LocaleNCompare("fxc:",property,4) == 0))
+ if (LocaleNCompare("fx:",property,3) == 0)
{
- fx_info=AcquireFxInfo(image,property+
- (LocaleNCompare("fx:",property,3) == 0 ? 3 : 4));
+ fx_info=AcquireFxInfo(image,property+3);
status=FxEvaluateExpression(fx_info,&alpha,exception);
fx_info=DestroyFxInfo(fx_info);
if (status != MagickFalse)
char
value[MaxTextExtent];
- (void) FormatMagickString(value,MaxTextExtent,"%g",(double)
- alpha);
+ (void) FormatMagickString(value,MaxTextExtent,"%.*g",
+ GetMagickPrecision(),(double) alpha);
(void) SetImageProperty((Image *) image,property,value);
}
p=(const char *) GetValueFromSplayTree((SplayTreeInfo *)
(void) GetImageChannelRange(image,image_info->channel,&minimum,
&maximum,&image->exception);
- (void) FormatMagickString(value,MaxTextExtent,"%g",maximum);
+ (void) FormatMagickString(value,MaxTextExtent,"%.*g",
+ GetMagickPrecision(),maximum);
break;
}
if (LocaleNCompare("mean",property,4) == 0)
(void) GetImageChannelRange(image,image_info->channel,&minimum,
&maximum,&image->exception);
- (void) FormatMagickString(value,MaxTextExtent,"%g",minimum);
+ (void) FormatMagickString(value,MaxTextExtent,"%.*g",
+ GetMagickPrecision(),minimum);
break;
}
break;
MagickExport MagickBooleanType SetImageProperty(Image *image,
const char *property,const char *value)
{
+ ExceptionInfo
+ *exception;
+
MagickBooleanType
status;
if ((value == (const char *) NULL) || (*value == '\0'))
return(DeleteImageProperty(image,property));
status=MagickTrue;
+ exception=(&image->exception);
switch (*property)
{
case 'B':
case 'b':
{
+ if (LocaleCompare(property,"background") == 0)
+ {
+ (void) QueryColorDatabase(value,&image->background_color,exception);
+ break;
+ }
if (LocaleCompare(property,"bias") == 0)
{
image->bias=SiPrefixToDouble(value,QuantumRange);
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);
+ image->ticks_per_second=(ssize_t)
+ floor(geometry_info.sigma+0.5);
}
else
image->delay=(size_t) floor(geometry_info.rho+0.5);
image->ticks_per_second=(ssize_t) floor(geometry_info.sigma+0.5);
break;
}
+ if (LocaleCompare(property,"density") == 0)
+ {
+ GeometryInfo
+ geometry_info;
+
+ flags=ParseGeometry(value,&geometry_info);
+ image->x_resolution=geometry_info.rho;
+ image->y_resolution=geometry_info.sigma;
+ if ((flags & SigmaValue) == 0)
+ image->y_resolution=image->x_resolution;
+ }
if (LocaleCompare(property,"depth") == 0)
{
image->depth=StringToUnsignedLong(value);
image_info=AcquireImageInfo();
(void) CopyMagickString(image_info->filename,value,MaxTextExtent);
- (void) SetImageInfo(image_info,1,&image->exception);
- profile=FileToStringInfo(image_info->filename,~0UL,&image->exception);
+ (void) SetImageInfo(image_info,1,exception);
+ profile=FileToStringInfo(image_info->filename,~0UL,exception);
if (profile != (StringInfo *) NULL)
status=SetImageProfile(image,image_info->magick,profile);
image_info=DestroyImageInfo(image_info);
ConstantString(property),ConstantString(value));
break;
}
+ case 'U':
+ case 'u':
+ {
+ if (LocaleCompare(property,"units") == 0)
+ {
+ ssize_t
+ units;
+
+ units=ParseMagickOption(MagickResolutionOptions,MagickFalse,value);
+ if (units < 0)
+ break;
+ image->units=(ResolutionType) units;
+ break;
+ }
+ status=AddValueToSplayTree((SplayTreeInfo *) image->properties,
+ ConstantString(property),ConstantString(value));
+ break;
+ }
default:
{
status=AddValueToSplayTree((SplayTreeInfo *) image->properties,