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

« back to all changes in this revision

Viewing changes to coders/rla.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:
118
118
      blue_primary[24],
119
119
      white_point[24];
120
120
 
121
 
    ssize_t
 
121
    long
122
122
      job_number;
123
123
 
124
124
    char
150
150
      auxiliary[32],
151
151
      space[36];
152
152
 
153
 
    ssize_t
 
153
    long
154
154
      next;
155
155
  } RLAInfo;
156
156
 
162
162
    length,
163
163
    runlength;
164
164
 
165
 
  ssize_t
 
165
  long
166
166
    y;
167
167
 
168
 
  ssize_t
 
168
  long
169
169
    *scanlines;
170
170
 
171
171
  MagickBooleanType
174
174
  MagickOffsetType
175
175
    offset;
176
176
 
177
 
  register ssize_t
 
177
  register long
178
178
    i,
179
179
    x;
180
180
 
229
229
  count=ReadBlob(image,24,(unsigned char *) rla_info.green_primary);
230
230
  count=ReadBlob(image,24,(unsigned char *) rla_info.blue_primary);
231
231
  count=ReadBlob(image,24,(unsigned char *) rla_info.white_point);
232
 
  rla_info.job_number=(ssize_t) ReadBlobMSBLong(image);
 
232
  rla_info.job_number=(long) ReadBlobMSBLong(image);
233
233
  count=ReadBlob(image,128,(unsigned char *) rla_info.name);
234
234
  count=ReadBlob(image,128,(unsigned char *) rla_info.description);
235
235
  count=ReadBlob(image,64,(unsigned char *) rla_info.program);
251
251
  count=ReadBlob(image,36,(unsigned char *) rla_info.space);
252
252
  if ((size_t) count != 36)
253
253
    ThrowReaderException(CorruptImageError,"UnableToReadImageData");
254
 
  rla_info.next=(ssize_t) ReadBlobMSBLong(image);
 
254
  rla_info.next=(long) ReadBlobMSBLong(image);
255
255
  /*
256
256
    Initialize image structure.
257
257
  */
263
263
      (void) CloseBlob(image);
264
264
      return(GetFirstImageInList(image));
265
265
    }
266
 
  scanlines=(ssize_t *) AcquireQuantumMemory(image->rows,sizeof(*scanlines));
267
 
  if (scanlines == (ssize_t *) NULL)
 
266
  scanlines=(long *) AcquireQuantumMemory(image->rows,sizeof(*scanlines));
 
267
  if (scanlines == (long *) NULL)
268
268
    ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
269
269
  if (*rla_info.description != '\0')
270
270
    (void) SetImageProperty(image,"comment",rla_info.description);
271
271
  /*
272
272
    Read offsets to each scanline data.
273
273
  */
274
 
  for (i=0; i < (ssize_t) image->rows; i++)
275
 
    scanlines[i]=(ssize_t) ReadBlobMSBLong(image);
 
274
  for (i=0; i < (long) image->rows; i++)
 
275
    scanlines[i]=(long) ReadBlobMSBLong(image);
276
276
  /*
277
277
    Read image data.
278
278
  */
279
279
  x=0;
280
 
  for (y=0; y < (ssize_t) image->rows; y++)
 
280
  for (y=0; y < (long) image->rows; y++)
281
281
  {
282
282
    offset=SeekBlob(image,scanlines[image->rows-y-1],SEEK_SET);
283
283
    if (offset < 0)
298
298
          {
299
299
            while (runlength < 0)
300
300
            {
301
 
              q=GetAuthenticPixels(image,(ssize_t) (x % image->columns),
302
 
                (ssize_t) (y % image->rows),1,1,exception);
 
301
              q=GetAuthenticPixels(image,(long) (x % image->columns),
 
302
                (long) (y % image->rows),1,1,exception);
303
303
              if (q == (PixelPacket *) NULL)
304
304
                break;
305
305
              byte=(unsigned char) ReadBlobByte(image);
340
340
        runlength++;
341
341
        do
342
342
        {
343
 
          q=GetAuthenticPixels(image,(ssize_t) (x % image->columns),
344
 
            (ssize_t) (y % image->rows),1,1,exception);
 
343
          q=GetAuthenticPixels(image,(long) (x % image->columns),
 
344
            (long) (y % image->rows),1,1,exception);
345
345
          if (q == (PixelPacket *) NULL)
346
346
            break;
347
347
          switch (channel)
376
376
        while (runlength > 0);
377
377
      }
378
378
    }
379
 
    status=SetImageProgress(image,LoadImageTag,(MagickOffsetType) y,
380
 
                image->rows);
 
379
    status=SetImageProgress(image,LoadImageTag,y,image->rows);
381
380
    if (status == MagickFalse)
382
381
      break;
383
382
  }
408
407
%
409
408
%  The format of the RegisterRLAImage method is:
410
409
%
411
 
%      size_t RegisterRLAImage(void)
 
410
%      unsigned long RegisterRLAImage(void)
412
411
%
413
412
*/
414
 
ModuleExport size_t RegisterRLAImage(void)
 
413
ModuleExport unsigned long RegisterRLAImage(void)
415
414
{
416
415
  MagickInfo
417
416
    *entry;