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

« back to all changes in this revision

Viewing changes to coders/vicar.c

  • Committer: Bazaar Package Importer
  • Author(s): Nelson A. de Oliveira
  • Date: 2010-06-20 19:59:55 UTC
  • mfrom: (6.2.8 sid)
  • Revision ID: james.westby@ubuntu.com-20100620195955-n3eq0yenhycw888i
Tags: 7:6.6.2.6-1
* New upstream release;
* Change Recommends on ufraw to ufraw-batch (Closes: #579775);
* Fix FTBFS when using dash to run the configure script, by setting
  CONFIG_SHELL=/bin/bash (Closes: #582073, #583024). Thank you, Niko Tyni!

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
%                                 July 1992                                   %
18
18
%                                                                             %
19
19
%                                                                             %
20
 
%  Copyright 1999-2009 ImageMagick Studio LLC, a non-profit organization      %
 
20
%  Copyright 1999-2010 ImageMagick Studio LLC, a non-profit organization      %
21
21
%  dedicated to making software imaging solutions freely available.           %
22
22
%                                                                             %
23
23
%  You may not use this file except in compliance with the License.  You may  %
43
43
#include "magick/blob.h"
44
44
#include "magick/blob-private.h"
45
45
#include "magick/cache.h"
 
46
#include "magick/colormap.h"
46
47
#include "magick/colorspace.h"
47
48
#include "magick/constitute.h"
48
49
#include "magick/exception.h"
52
53
#include "magick/list.h"
53
54
#include "magick/magick.h"
54
55
#include "magick/memory_.h"
 
56
#include "magick/module.h"
55
57
#include "magick/monitor.h"
56
58
#include "magick/monitor-private.h"
57
59
#include "magick/quantum-private.h"
58
60
#include "magick/quantum-private.h"
59
61
#include "magick/static.h"
60
62
#include "magick/string_.h"
61
 
#include "magick/module.h"
 
63
#include "magick/string-private.h"
62
64
 
63
65
/*
64
66
  Forward declarations.
151
153
  int
152
154
    c;
153
155
 
154
 
  long
 
156
  ssize_t
155
157
    y;
156
158
 
157
159
  MagickBooleanType
253
255
          Assign a value to the specified keyword.
254
256
        */
255
257
        if (LocaleCompare(keyword,"Label_RECORDS") == 0)
256
 
          length=(ssize_t) atol(value);
 
258
          length=(ssize_t) StringToLong(value);
257
259
        if (LocaleCompare(keyword,"LBLSIZE") == 0)
258
 
          length=(ssize_t) atol(value);
 
260
          length=(ssize_t) StringToLong(value);
259
261
        if (LocaleCompare(keyword,"RECORD_BYTES") == 0)
260
 
          image->columns=1UL*atol(value);
 
262
          image->columns=StringToUnsignedLong(value);
261
263
        if (LocaleCompare(keyword,"NS") == 0)
262
 
          image->columns=1UL*atol(value);
 
264
          image->columns=StringToUnsignedLong(value);
263
265
        if (LocaleCompare(keyword,"LINES") == 0)
264
 
          image->rows=1UL*atol(value);
 
266
          image->rows=StringToUnsignedLong(value);
265
267
        if (LocaleCompare(keyword,"NL") == 0)
266
 
          image->rows=1UL*atol(value);
 
268
          image->rows=StringToUnsignedLong(value);
267
269
      }
268
270
    while (isspace((int) ((unsigned char) c)) != 0)
269
271
    {
295
297
    ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
296
298
  pixels=GetQuantumPixels(quantum_info);
297
299
  length=GetQuantumExtent(image,quantum_info,IndexQuantum);
298
 
  for (y=0; y < (long) image->rows; y++)
 
300
  for (y=0; y < (ssize_t) image->rows; y++)
299
301
  {
300
302
    q=QueueAuthenticPixels(image,0,y,image->columns,1,exception);
301
303
    if (q == (PixelPacket *) NULL)
305
307
      quantum_type,pixels,exception);
306
308
    if (SyncAuthenticPixels(image,exception) == MagickFalse)
307
309
      break;
308
 
    status=SetImageProgress(image,LoadImageTag,y,image->rows);
 
310
    status=SetImageProgress(image,LoadImageTag,(MagickOffsetType) y,
 
311
                image->rows);
309
312
    if (status == MagickFalse)
310
313
      break;
311
314
  }
338
341
%
339
342
%  The format of the RegisterVICARImage method is:
340
343
%
341
 
%      unsigned long RegisterVICARImage(void)
 
344
%      size_t RegisterVICARImage(void)
342
345
%
343
346
*/
344
 
ModuleExport unsigned long RegisterVICARImage(void)
 
347
ModuleExport size_t RegisterVICARImage(void)
345
348
{
346
349
  MagickInfo
347
350
    *entry;
459
462
  */
460
463
  (void) ResetMagickMemory(header,' ',MaxTextExtent);
461
464
  (void) FormatMagickString(header,MaxTextExtent,
462
 
    "LBLSIZE=%lu FORMAT='BYTE' TYPE='IMAGE' BUFSIZE=20000 DIM=2 EOL=0 "
463
 
    "RECSIZE=%lu ORG='BSQ' NL=%lu NS=%lu NB=1 N1=0 N2=0 N3=0 N4=0 NBB=0 "
464
 
    "NLB=0 TASK='ImageMagick'",(unsigned long) MaxTextExtent,image->columns,
465
 
    image->rows,image->columns);
 
465
    "LBLSIZE=%.20g FORMAT='BYTE' TYPE='IMAGE' BUFSIZE=20000 DIM=2 EOL=0 "
 
466
    "RECSIZE=%.20g ORG='BSQ' NL=%.20g NS=%.20g NB=1 N1=0 N2=0 N3=0 N4=0 NBB=0 "
 
467
    "NLB=0 TASK='ImageMagick'",(double) MaxTextExtent,(double) image->columns,
 
468
    (double) image->rows,(double) image->columns);
466
469
  (void) WriteBlob(image,MaxTextExtent,(unsigned char *) header);
467
470
  /*
468
471
    Write VICAR pixels.
472
475
  if (quantum_info == (QuantumInfo *) NULL)
473
476
    ThrowWriterException(ResourceLimitError,"MemoryAllocationFailed");
474
477
  pixels=GetQuantumPixels(quantum_info);
475
 
  for (y=0; y < (long) image->rows; y++)
 
478
  for (y=0; y < (ssize_t) image->rows; y++)
476
479
  {
477
480
    p=GetVirtualPixels(image,0,y,image->columns,1,&image->exception);
478
481
    if (p == (const PixelPacket *) NULL)
482
485
    count=WriteBlob(image,length,pixels);
483
486
    if (count != (ssize_t) length)
484
487
      break;
485
 
    status=SetImageProgress(image,SaveImageTag,y,image->rows);
 
488
    status=SetImageProgress(image,SaveImageTag,(MagickOffsetType) y,
 
489
                image->rows);
486
490
    if (status == MagickFalse)
487
491
      break;
488
492
  }