char
*caption,
geometry[MagickPathExtent],
- *property,
*text;
const char
*/
option=GetImageOption(image_info,"filename");
if (option == (const char *) NULL)
- property=InterpretImageProperties((ImageInfo *) image_info,image,
+ caption=InterpretImageProperties((ImageInfo *) image_info,image,
image_info->filename,exception);
else
if (LocaleNCompare(option,"caption:",8) == 0)
- property=InterpretImageProperties((ImageInfo *) image_info,image,option+8,
+ caption=InterpretImageProperties((ImageInfo *) image_info,image,option+8,
exception);
else
- property=InterpretImageProperties((ImageInfo *) image_info,image,option,
+ caption=InterpretImageProperties((ImageInfo *) image_info,image,option,
exception);
- if (property == (char *) NULL)
+ if (caption == (char *) NULL)
return(DestroyImageList(image));
- (void) SetImageProperty(image,"caption",property,exception);
- property=DestroyString(property);
- caption=ConstantString(GetImageProperty(image,"caption",exception));
+ (void) SetImageProperty(image,"caption",caption,exception);
draw_info=CloneDrawInfo(image_info,(DrawInfo *) NULL);
- width=draw_info->pointsize*strlen(caption);
+ width=(size_t) floor(draw_info->pointsize*strlen(caption)+0.5);
if (AcquireMagickResource(WidthResource,width) == MagickFalse)
{
caption=DestroyString(caption);
*/
i=FormatMagickCaption(image,draw_info,split,&metrics,&caption,exception);
(void) CloneString(&draw_info->text,caption);
+ caption=DestroyString(caption);
(void) FormatLocaleString(geometry,MagickPathExtent,"%+g%+g",MagickMax(
- draw_info->direction == RightToLeftDirection ? image->columns-
+ draw_info->direction == RightToLeftDirection ? (double) image->columns-
metrics.bounds.x2 : -metrics.bounds.x1,0.0),draw_info->gravity ==
UndefinedGravity ? metrics.ascent : 0.0);
(void) CloneString(&draw_info->geometry,geometry);
(void) SetImageProperty(image,"caption:pointsize",pointsize,exception);
}
draw_info=DestroyDrawInfo(draw_info);
- caption=DestroyString(caption);
if (status == MagickFalse)
{
image=DestroyImageList(image);
{
char
geometry[MagickPathExtent],
- *property;
-
- const char
*label;
DrawInfo
(void) ResetImagePage(image,"0x0+0+0");
if ((image->columns != 0) && (image->rows != 0))
(void) SetImageBackgroundColor(image,exception);
- property=InterpretImageProperties((ImageInfo *) image_info,image,
+ label=InterpretImageProperties((ImageInfo *) image_info,image,
image_info->filename,exception);
- if (property == (char *) NULL)
+ if (label == (char *) NULL)
return(DestroyImageList(image));
- (void) SetImageProperty(image,"label",property,exception);
- property=DestroyString(property);
- label=GetImageProperty(image,"label",exception);
+ (void) SetImageProperty(image,"label",label,exception);
draw_info=CloneDrawInfo(image_info,(DrawInfo *) NULL);
- width=draw_info->pointsize*strlen(label);
+ width=(size_t) floor(draw_info->pointsize*strlen(label)+0.5);
if (AcquireMagickResource(WidthResource,width) == MagickFalse)
{
+ label=DestroyString(label);
draw_info=DestroyDrawInfo(draw_info);
ThrowReaderException(ImageError,"WidthOrHeightExceedsLimit");
}
}
if (status == MagickFalse)
{
+ label=DestroyString(label);
draw_info=DestroyDrawInfo(draw_info);
image=DestroyImageList(image);
return((Image *) NULL);
status=GetMultilineTypeMetrics(image,draw_info,&metrics,exception);
}
}
+ label=DestroyString(label);
if (status == MagickFalse)
{
draw_info=DestroyDrawInfo(draw_info);