From 01d9367d0c1b89ad48979ed10b6374653f5f3a5a Mon Sep 17 00:00:00 2001 From: cristy Date: Sun, 25 Nov 2012 23:19:48 +0000 Subject: [PATCH] --- coders/label.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/coders/label.c b/coders/label.c index c4f6860a4..e55480962 100644 --- a/coders/label.c +++ b/coders/label.c @@ -150,7 +150,8 @@ static Image *ReadLABELImage(const ImageInfo *image_info, (void) status; width=(size_t) floor(metrics.width+draw_info->stroke_width+0.5); height=(size_t) floor(metrics.height+draw_info->stroke_width+0.5); - if ((width > image->columns) && (height > image->rows)) + if (((image->columns != 0) && (width > image->columns)) || + ((image->rows != 0) && (height > image->rows))) break; draw_info->pointsize*=2.0; } @@ -166,12 +167,13 @@ static Image *ReadLABELImage(const ImageInfo *image_info, status=GetMultilineTypeMetrics(image,draw_info,&metrics,exception); width=(size_t) floor(metrics.width+draw_info->stroke_width+0.5); height=(size_t) floor(metrics.height+draw_info->stroke_width+0.5); - if ((width <= image->columns) && (height <= image->rows)) + if (((image->columns != 0) && (width <= image->columns)) || + ((image->rows != 0) && (height <= image->rows))) low=draw_info->pointsize+1.0; else high=draw_info->pointsize-1.0; } - for (draw_info->pointsize=(low+high)/2.0; (high-low) > 1.0; ) + for (draw_info->pointsize=(low+high)/2.0; ; ) { (void) FormatLocaleString(geometry,MaxTextExtent,"%+g%+g", -metrics.bounds.x1,metrics.ascent); @@ -180,7 +182,8 @@ static Image *ReadLABELImage(const ImageInfo *image_info, status=GetMultilineTypeMetrics(image,draw_info,&metrics,exception); width=(size_t) floor(metrics.width+draw_info->stroke_width+0.5); height=(size_t) floor(metrics.height+draw_info->stroke_width+0.5); - if ((width <= image->columns) && (height <= image->rows)) + if (((image->columns != 0) && (width <= image->columns)) || + ((image->rows != 0) && (height <= image->rows))) break; draw_info->pointsize--; } -- 2.40.0