~ubuntu-branches/ubuntu/oneiric/imagemagick/oneiric-updates

« back to all changes in this revision

Viewing changes to coders/caption.c

  • Committer: Bazaar Package Importer
  • Author(s): Colin Watson
  • Date: 2011-06-15 11:05:28 UTC
  • mfrom: (6.2.11 sid)
  • Revision ID: james.westby@ubuntu.com-20110615110528-08jgo07a4846xh8d
Tags: 8:6.6.0.4-3ubuntu1
* Resynchronise with Debian (LP: #797595).  Remaining changes:
  - Make ufraw-batch (universe) a suggestion instead of a recommendation.
  - Make debian/rules install target depend on check; they cannot reliably
    be run in parallel.
  - Don't set MAKEFLAGS in debian/rules; just pass it to the build.

Show diffs side-by-side

added added

removed removed

Lines of Context:
105
105
  MagickBooleanType
106
106
    status;
107
107
 
108
 
  register ssize_t
 
108
  register long
109
109
    i;
110
110
 
111
111
  TypeMetric
112
112
    metrics;
113
113
 
114
 
  size_t
 
114
  unsigned long
115
115
    height,
116
116
    width;
117
117
 
162
162
        if (draw_info->gravity == UndefinedGravity)
163
163
          (void) CloneString(&draw_info->geometry,geometry);
164
164
        status=GetMultilineTypeMetrics(image,draw_info,&metrics);
165
 
        width=(size_t) floor(metrics.width+draw_info->stroke_width+0.5);
166
 
        height=(size_t) floor(metrics.height+draw_info->stroke_width+
167
 
          0.5);
 
165
        width=(unsigned long) (metrics.width+draw_info->stroke_width+0.5);
 
166
        height=(unsigned long) (metrics.height+draw_info->stroke_width+0.5);
168
167
        if ((width > (image->columns+1)) || (height > (image->rows+1)))
169
168
          break;
170
169
        draw_info->pointsize*=2.0;
181
180
        if (draw_info->gravity == UndefinedGravity)
182
181
          (void) CloneString(&draw_info->geometry,geometry);
183
182
        status=GetMultilineTypeMetrics(image,draw_info,&metrics);
184
 
        width=(size_t) floor(metrics.width+draw_info->stroke_width+0.5);
185
 
        height=(size_t) floor(metrics.height+draw_info->stroke_width+
186
 
          0.5);
 
183
        width=(unsigned long) (metrics.width+draw_info->stroke_width+0.5);
 
184
        height=(unsigned long) (metrics.height+draw_info->stroke_width+0.5);
187
185
        if ((width > (image->columns+1)) || (height > (image->rows+1)))
188
186
          break;
189
187
        draw_info->pointsize++;
192
190
    }
193
191
  i=FormatMagickCaption(image,draw_info,&metrics,&caption);
194
192
  if (image->rows == 0)
195
 
    image->rows=(size_t) ((i+1)*(metrics.ascent-metrics.descent+
 
193
    image->rows=(unsigned long) ((i+1)*(metrics.ascent-metrics.descent+
196
194
      draw_info->stroke_width)+0.5);
197
195
  if (image->rows == 0)
198
 
    image->rows=(size_t) ((i+1)*draw_info->pointsize+
 
196
    image->rows=(unsigned long) ((i+1)*draw_info->pointsize+
199
197
      draw_info->stroke_width+0.5);
200
198
  if (SetImageBackgroundColor(image) == MagickFalse)
201
199
    {
209
207
  (void) CloneString(&draw_info->text,caption);
210
208
  status=GetMultilineTypeMetrics(image,draw_info,&metrics);
211
209
  if (draw_info->gravity != UndefinedGravity)
212
 
    image->page.x=(ssize_t) (metrics.bounds.x1-draw_info->stroke_width/2.0);
 
210
    image->page.x=(long) (metrics.bounds.x1-draw_info->stroke_width/2.0);
213
211
  else
214
212
    {
215
213
      (void) FormatMagickString(geometry,MaxTextExtent,"%+g%+g",
243
241
%
244
242
%  The format of the RegisterCAPTIONImage method is:
245
243
%
246
 
%      size_t RegisterCAPTIONImage(void)
 
244
%      unsigned long RegisterCAPTIONImage(void)
247
245
%
248
246
*/
249
 
ModuleExport size_t RegisterCAPTIONImage(void)
 
247
ModuleExport unsigned long RegisterCAPTIONImage(void)
250
248
{
251
249
  MagickInfo
252
250
    *entry;