~ubuntu-branches/ubuntu/quantal/imagemagick/quantal

« back to all changes in this revision

Viewing changes to wand/identify.c

  • Committer: Bazaar Package Importer
  • Author(s): Muharem Hrnjadovic
  • Date: 2009-06-04 13:01:13 UTC
  • mfrom: (1.1.5 upstream) (6.1.1 sid)
  • Revision ID: james.westby@ubuntu.com-20090604130113-my9114jxmafpwew3
Tags: 7:6.5.1.0-1.1ubuntu1
* Merge from debian unstable, remaining changes:
  - (Build-)depend on libltdl7-dev instead of libltdl3-dev (the armel buildds
    currently have both available).
  - Don't build-dep on librsvg, it brings in excessive dependencies

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
%                            September 1994                                   %
18
18
%                                                                             %
19
19
%                                                                             %
20
 
%  Copyright 1999-2008 ImageMagick Studio LLC, a non-profit organization      %
 
20
%  Copyright 1999-2009 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  %
80
80
%
81
81
%    o metadata: any metadata is returned here.
82
82
%
83
 
%    o exception: Return any errors or warnings in this structure.
 
83
%    o exception: return any errors or warnings in this structure.
84
84
%
85
85
*/
86
86
 
87
 
static void IdentifyUsage(void)
 
87
static MagickBooleanType IdentifyUsage(void)
88
88
{
89
89
  const char
90
90
    **p;
123
123
      "-ping                efficiently determine image attributes",
124
124
      "-quiet               suppress all warning messages",
125
125
      "-regard-warnings     pay attention to warning messages",
126
 
      "-respect-parenthesis settings remain in effect until parenthesis boundary",
 
126
      "-respect-parentheses settings remain in effect until parenthesis boundary",
127
127
      "-sampling-factor geometry",
128
128
      "                     horizontal and vertical sampling factor",
129
129
      "-seed value          seed a new sequence of pseudo-random numbers",
156
156
  (void) printf(
157
157
    "image type as the filename suffix (i.e. image.ps).  Specify 'file' as\n");
158
158
  (void) printf("'-' for standard input or output.\n");
159
 
  exit(0);
 
159
  return(MagickFalse);
160
160
}
161
161
 
162
162
WandExport MagickBooleanType IdentifyImageCommand(ImageInfo *image_info,
179
179
#define ThrowIdentifyInvalidArgumentException(option,argument) \
180
180
{ \
181
181
  (void) ThrowMagickException(exception,GetMagickModule(),OptionError, \
182
 
    "InvalidArgument","`%s': %s",argument,option); \
 
182
    "InvalidArgument","`%s': %s",option,argument); \
183
183
  DestroyIdentify(); \
184
184
  return(MagickFalse); \
185
185
}
228
228
          (void) fprintf(stdout,"Version: %s\n",
229
229
            GetMagickVersion((unsigned long *) NULL));
230
230
          (void) fprintf(stdout,"Copyright: %s\n\n",GetMagickCopyright());
231
 
          return(MagickTrue);
 
231
          return(MagickFalse);
232
232
        }
233
233
    }
234
234
  if (argc < 2)
235
 
    IdentifyUsage();
 
235
    {
 
236
      (void) IdentifyUsage();
 
237
      return(MagickTrue);
 
238
    }
236
239
  count=0;
237
240
  format=NULL;
238
241
  j=1;
249
252
  if (status == MagickFalse)
250
253
    ThrowIdentifyException(ResourceLimitError,"MemoryAllocationFailed",
251
254
      strerror(errno));
 
255
  image_info->ping=MagickTrue;
252
256
  for (i=1; i < (long) argc; i++)
253
257
  {
254
258
    option=argv[i];
525
529
      {
526
530
        if ((LocaleCompare("help",option+1) == 0) ||
527
531
            (LocaleCompare("-help",option+1) == 0))
528
 
          IdentifyUsage();
 
532
          return(IdentifyUsage());
529
533
        ThrowIdentifyException(OptionError,"UnrecognizedOption",option)
530
534
      }
531
535
      case 'i':
573
577
            char
574
578
              *p;
575
579
 
 
580
            double
 
581
              value;
 
582
 
576
583
            long
577
584
              resource;
578
585
 
589
596
            i++;
590
597
            if (i == (long) argc)
591
598
              ThrowIdentifyException(OptionError,"MissingArgument",option);
592
 
            (void) strtod(argv[i],&p);
 
599
            value=strtod(argv[i],&p);
593
600
            if ((p == argv[i]) && (LocaleCompare("unlimited",argv[i]) != 0))
594
601
              ThrowIdentifyInvalidArgumentException(option,argv[i]);
595
602
            break;
649
656
      {
650
657
        if (LocaleCompare("regard-warnings",option+1) == 0)
651
658
          break;
652
 
        if (LocaleCompare("respect-parenthesis",option+1) == 0)
 
659
        if (LocaleNCompare("respect-parentheses",option+1,17) == 0)
653
660
          {
654
661
            respect_parenthesis=(*option == '-') ? MagickTrue : MagickFalse;
655
662
            break;