13ed852eea50f9d4cd633efb8c2b054b8e33c253cristy/*
23ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
33ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%                                                                             %
43ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%                                                                             %
53ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%                                                                             %
63ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%           IIIII  DDDD   EEEEE  N   N  TTTTT  IIIII  FFFFF  Y   Y            %
73ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%             I    D   D  E      NN  N    T      I    F       Y Y             %
83ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%             I    D   D  EEE    N N N    T      I    FFF      Y              %
93ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%             I    D   D  E      N  NN    T      I    F        Y              %
103ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%           IIIII  DDDD   EEEEE  N   N    T    IIIII  F        Y              %
113ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%                                                                             %
123ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%                                                                             %
133ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%               Identify an Image Format and Characteristics.                 %
143ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%                                                                             %
153ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%                           Software Design                                   %
16de984cdc3631106b1cbbb8d3972b76a0fc27e8e8cristy%                                Cristy                                       %
173ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%                            September 1994                                   %
183ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%                                                                             %
193ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%                                                                             %
207ce65e7125a4e1df1a274ce373c537a9df9c16cdCristy%  Copyright 1999-2016 ImageMagick Studio LLC, a non-profit organization      %
213ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%  dedicated to making software imaging solutions freely available.           %
223ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%                                                                             %
233ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%  You may not use this file except in compliance with the License.  You may  %
243ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%  obtain a copy of the License at                                            %
253ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%                                                                             %
263ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%    http://www.imagemagick.org/script/license.php                            %
273ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%                                                                             %
283ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%  Unless required by applicable law or agreed to in writing, software        %
293ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%  distributed under the License is distributed on an "AS IS" BASIS,          %
303ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   %
313ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%  See the License for the specific language governing permissions and        %
323ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%  limitations under the License.                                             %
333ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%                                                                             %
343ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
353ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%
363ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%  Identify describes the format and characteristics of one or more image
373ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%  files.  It will also report if an image is incomplete or corrupt.
383ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%
393ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%
403ed852eea50f9d4cd633efb8c2b054b8e33c253cristy*/
413ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
423ed852eea50f9d4cd633efb8c2b054b8e33c253cristy/*
433ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  Include declarations.
443ed852eea50f9d4cd633efb8c2b054b8e33c253cristy*/
454c08aed51c5899665ade97263692328eea4af106cristy#include "MagickCore/studio.h"
464c08aed51c5899665ade97263692328eea4af106cristy#include "MagickCore/annotate.h"
474c08aed51c5899665ade97263692328eea4af106cristy#include "MagickCore/artifact.h"
484c08aed51c5899665ade97263692328eea4af106cristy#include "MagickCore/attribute.h"
494c08aed51c5899665ade97263692328eea4af106cristy#include "MagickCore/blob.h"
504c08aed51c5899665ade97263692328eea4af106cristy#include "MagickCore/cache.h"
514c08aed51c5899665ade97263692328eea4af106cristy#include "MagickCore/client.h"
524c08aed51c5899665ade97263692328eea4af106cristy#include "MagickCore/coder.h"
534c08aed51c5899665ade97263692328eea4af106cristy#include "MagickCore/color.h"
544c08aed51c5899665ade97263692328eea4af106cristy#include "MagickCore/configure.h"
554c08aed51c5899665ade97263692328eea4af106cristy#include "MagickCore/constitute.h"
564c08aed51c5899665ade97263692328eea4af106cristy#include "MagickCore/decorate.h"
574c08aed51c5899665ade97263692328eea4af106cristy#include "MagickCore/delegate.h"
584c08aed51c5899665ade97263692328eea4af106cristy#include "MagickCore/draw.h"
594c08aed51c5899665ade97263692328eea4af106cristy#include "MagickCore/effect.h"
604c08aed51c5899665ade97263692328eea4af106cristy#include "MagickCore/exception.h"
614c08aed51c5899665ade97263692328eea4af106cristy#include "MagickCore/exception-private.h"
624c08aed51c5899665ade97263692328eea4af106cristy#include "MagickCore/feature.h"
634c08aed51c5899665ade97263692328eea4af106cristy#include "MagickCore/gem.h"
644c08aed51c5899665ade97263692328eea4af106cristy#include "MagickCore/geometry.h"
654c08aed51c5899665ade97263692328eea4af106cristy#include "MagickCore/histogram.h"
664c08aed51c5899665ade97263692328eea4af106cristy#include "MagickCore/identify.h"
674c08aed51c5899665ade97263692328eea4af106cristy#include "MagickCore/image.h"
684c08aed51c5899665ade97263692328eea4af106cristy#include "MagickCore/image-private.h"
694c08aed51c5899665ade97263692328eea4af106cristy#include "MagickCore/list.h"
704c08aed51c5899665ade97263692328eea4af106cristy#include "MagickCore/locale_.h"
714c08aed51c5899665ade97263692328eea4af106cristy#include "MagickCore/log.h"
724c08aed51c5899665ade97263692328eea4af106cristy#include "MagickCore/magic.h"
734c08aed51c5899665ade97263692328eea4af106cristy#include "MagickCore/magick.h"
744c08aed51c5899665ade97263692328eea4af106cristy#include "MagickCore/memory_.h"
754c08aed51c5899665ade97263692328eea4af106cristy#include "MagickCore/module.h"
764c08aed51c5899665ade97263692328eea4af106cristy#include "MagickCore/monitor.h"
774c08aed51c5899665ade97263692328eea4af106cristy#include "MagickCore/montage.h"
784c08aed51c5899665ade97263692328eea4af106cristy#include "MagickCore/option.h"
794c08aed51c5899665ade97263692328eea4af106cristy#include "MagickCore/pixel-accessor.h"
804c08aed51c5899665ade97263692328eea4af106cristy#include "MagickCore/prepress.h"
814c08aed51c5899665ade97263692328eea4af106cristy#include "MagickCore/profile.h"
824c08aed51c5899665ade97263692328eea4af106cristy#include "MagickCore/property.h"
834c08aed51c5899665ade97263692328eea4af106cristy#include "MagickCore/quantize.h"
844c08aed51c5899665ade97263692328eea4af106cristy#include "MagickCore/quantum.h"
854c08aed51c5899665ade97263692328eea4af106cristy#include "MagickCore/random_.h"
864c08aed51c5899665ade97263692328eea4af106cristy#include "MagickCore/registry.h"
874c08aed51c5899665ade97263692328eea4af106cristy#include "MagickCore/resize.h"
884c08aed51c5899665ade97263692328eea4af106cristy#include "MagickCore/resource_.h"
894c08aed51c5899665ade97263692328eea4af106cristy#include "MagickCore/signature.h"
904c08aed51c5899665ade97263692328eea4af106cristy#include "MagickCore/statistic.h"
914c08aed51c5899665ade97263692328eea4af106cristy#include "MagickCore/string_.h"
924c08aed51c5899665ade97263692328eea4af106cristy#include "MagickCore/string-private.h"
934c08aed51c5899665ade97263692328eea4af106cristy#include "MagickCore/timer.h"
9463a81879d3568083e4ee4f78ebcae2bc831cb764cristy#include "MagickCore/token.h"
954c08aed51c5899665ade97263692328eea4af106cristy#include "MagickCore/utility.h"
96d1dd6e4fefa0810b9893e6ac9418f79c97c1b39acristy#include "MagickCore/utility-private.h"
974c08aed51c5899665ade97263692328eea4af106cristy#include "MagickCore/version.h"
98d09bcf93011dfb02a8054b6082ca75e929148de8cristy
99d09bcf93011dfb02a8054b6082ca75e929148de8cristy/*
1003ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1013ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%                                                                             %
1023ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%                                                                             %
1033ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%                                                                             %
1043ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%   I d e n t i f y I m a g e                                                 %
1053ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%                                                                             %
1063ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%                                                                             %
1073ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%                                                                             %
1083ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1093ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%
1103ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%  IdentifyImage() identifies an image by printing its attributes to the file.
1113ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%  Attributes include the image width, height, size, and others.
1123ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%
1133ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%  The format of the IdentifyImage method is:
1143ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%
1153ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%      MagickBooleanType IdentifyImage(Image *image,FILE *file,
116a403727ea73ef5840a476a3c4614445807f42827cristy%        const MagickBooleanType verbose,ExceptionInfo *exception)
1173ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%
1183ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%  A description of each parameter follows:
1193ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%
1203ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%    o image: the image.
1213ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%
1223ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%    o file: the file, typically stdout.
1233ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%
1243ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%    o verbose: A value other than zero prints more detailed information
1253ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%      about the image.
1263ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%
127a403727ea73ef5840a476a3c4614445807f42827cristy%    o exception: return any errors or warnings in this structure.
128a403727ea73ef5840a476a3c4614445807f42827cristy%
1293ed852eea50f9d4cd633efb8c2b054b8e33c253cristy*/
1303ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
131ab00885761fe5e51444ced72ac97f82b86063437cristystatic ChannelStatistics *GetLocationStatistics(const Image *image,
132ab00885761fe5e51444ced72ac97f82b86063437cristy  const StatisticType type,ExceptionInfo *exception)
133f61a67f6bbdb636cece5542609e814f738b1e4e2cristy{
134ab00885761fe5e51444ced72ac97f82b86063437cristy  ChannelStatistics
135ab00885761fe5e51444ced72ac97f82b86063437cristy    *channel_statistics;
136ab00885761fe5e51444ced72ac97f82b86063437cristy
137f61a67f6bbdb636cece5542609e814f738b1e4e2cristy  register ssize_t
138f61a67f6bbdb636cece5542609e814f738b1e4e2cristy    i;
139f61a67f6bbdb636cece5542609e814f738b1e4e2cristy
140f61a67f6bbdb636cece5542609e814f738b1e4e2cristy  ssize_t
141f61a67f6bbdb636cece5542609e814f738b1e4e2cristy    y;
142f61a67f6bbdb636cece5542609e814f738b1e4e2cristy
143ab00885761fe5e51444ced72ac97f82b86063437cristy  assert(image != (Image *) NULL);
144e1c94d9d25db6b0dd7a5028ffee31d1057855d73cristy  assert(image->signature == MagickCoreSignature);
145f61a67f6bbdb636cece5542609e814f738b1e4e2cristy  if (image->debug != MagickFalse)
146f61a67f6bbdb636cece5542609e814f738b1e4e2cristy    (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
147ab00885761fe5e51444ced72ac97f82b86063437cristy  channel_statistics=(ChannelStatistics *) AcquireQuantumMemory(
148ab00885761fe5e51444ced72ac97f82b86063437cristy    MaxPixelChannels+1,sizeof(*channel_statistics));
149ab00885761fe5e51444ced72ac97f82b86063437cristy  if (channel_statistics == (ChannelStatistics *) NULL)
150ab00885761fe5e51444ced72ac97f82b86063437cristy    ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed");
151ab00885761fe5e51444ced72ac97f82b86063437cristy  (void) ResetMagickMemory(channel_statistics,0,(MaxPixelChannels+1)*
152ab00885761fe5e51444ced72ac97f82b86063437cristy    sizeof(*channel_statistics));
153f61a67f6bbdb636cece5542609e814f738b1e4e2cristy  for (i=0; i <= (ssize_t) MaxPixelChannels; i++)
154ab00885761fe5e51444ced72ac97f82b86063437cristy  {
155f61a67f6bbdb636cece5542609e814f738b1e4e2cristy    switch (type)
156f61a67f6bbdb636cece5542609e814f738b1e4e2cristy    {
157f61a67f6bbdb636cece5542609e814f738b1e4e2cristy      case MaximumStatistic:
158f61a67f6bbdb636cece5542609e814f738b1e4e2cristy      default:
159f61a67f6bbdb636cece5542609e814f738b1e4e2cristy      {
160fe181a767c3b3e61b9133829c504e75e34916de8cristy        channel_statistics[i].maxima=(-MagickMaximumValue);
161f61a67f6bbdb636cece5542609e814f738b1e4e2cristy        break;
162f61a67f6bbdb636cece5542609e814f738b1e4e2cristy      }
163f61a67f6bbdb636cece5542609e814f738b1e4e2cristy      case MinimumStatistic:
164f61a67f6bbdb636cece5542609e814f738b1e4e2cristy      {
165fe181a767c3b3e61b9133829c504e75e34916de8cristy        channel_statistics[i].minima=MagickMaximumValue;
166f61a67f6bbdb636cece5542609e814f738b1e4e2cristy        break;
167f61a67f6bbdb636cece5542609e814f738b1e4e2cristy      }
168f61a67f6bbdb636cece5542609e814f738b1e4e2cristy    }
169ab00885761fe5e51444ced72ac97f82b86063437cristy  }
170f61a67f6bbdb636cece5542609e814f738b1e4e2cristy  for (y=0; y < (ssize_t) image->rows; y++)
171f61a67f6bbdb636cece5542609e814f738b1e4e2cristy  {
172f61a67f6bbdb636cece5542609e814f738b1e4e2cristy    register const Quantum
17305d2ff7ebf21f659f5b11e45afb294e152f4330cdirk      *magick_restrict p;
174f61a67f6bbdb636cece5542609e814f738b1e4e2cristy
175f61a67f6bbdb636cece5542609e814f738b1e4e2cristy    register ssize_t
176f61a67f6bbdb636cece5542609e814f738b1e4e2cristy      x;
177f61a67f6bbdb636cece5542609e814f738b1e4e2cristy
178f61a67f6bbdb636cece5542609e814f738b1e4e2cristy    p=GetVirtualPixels(image,0,y,image->columns,1,exception);
179f61a67f6bbdb636cece5542609e814f738b1e4e2cristy    if (p == (const Quantum *) NULL)
180f61a67f6bbdb636cece5542609e814f738b1e4e2cristy      break;
181f61a67f6bbdb636cece5542609e814f738b1e4e2cristy    for (x=0; x < (ssize_t) image->columns; x++)
182f61a67f6bbdb636cece5542609e814f738b1e4e2cristy    {
183f61a67f6bbdb636cece5542609e814f738b1e4e2cristy      register ssize_t
184f61a67f6bbdb636cece5542609e814f738b1e4e2cristy        i;
185f61a67f6bbdb636cece5542609e814f738b1e4e2cristy
186f61a67f6bbdb636cece5542609e814f738b1e4e2cristy      if (GetPixelReadMask(image,p) == 0)
187f61a67f6bbdb636cece5542609e814f738b1e4e2cristy        {
188f61a67f6bbdb636cece5542609e814f738b1e4e2cristy          p+=GetPixelChannels(image);
189f61a67f6bbdb636cece5542609e814f738b1e4e2cristy          continue;
190f61a67f6bbdb636cece5542609e814f738b1e4e2cristy        }
191f61a67f6bbdb636cece5542609e814f738b1e4e2cristy      for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
192f61a67f6bbdb636cece5542609e814f738b1e4e2cristy      {
193f61a67f6bbdb636cece5542609e814f738b1e4e2cristy        PixelChannel channel=GetPixelChannelChannel(image,i);
194f61a67f6bbdb636cece5542609e814f738b1e4e2cristy        PixelTrait traits=GetPixelChannelTraits(image,channel);
195f61a67f6bbdb636cece5542609e814f738b1e4e2cristy        if (traits == UndefinedPixelTrait)
196f61a67f6bbdb636cece5542609e814f738b1e4e2cristy          continue;
197f61a67f6bbdb636cece5542609e814f738b1e4e2cristy        switch (type)
198f61a67f6bbdb636cece5542609e814f738b1e4e2cristy        {
199f61a67f6bbdb636cece5542609e814f738b1e4e2cristy          case MaximumStatistic:
200f61a67f6bbdb636cece5542609e814f738b1e4e2cristy          default:
201f61a67f6bbdb636cece5542609e814f738b1e4e2cristy          {
202ab00885761fe5e51444ced72ac97f82b86063437cristy            if ((double) p[i] > channel_statistics[channel].maxima)
203ab00885761fe5e51444ced72ac97f82b86063437cristy              channel_statistics[channel].maxima=(double) p[i];
204f61a67f6bbdb636cece5542609e814f738b1e4e2cristy            break;
205f61a67f6bbdb636cece5542609e814f738b1e4e2cristy          }
206f61a67f6bbdb636cece5542609e814f738b1e4e2cristy          case MinimumStatistic:
207f61a67f6bbdb636cece5542609e814f738b1e4e2cristy          {
208ab00885761fe5e51444ced72ac97f82b86063437cristy            if ((double) p[i] < channel_statistics[channel].minima)
209ab00885761fe5e51444ced72ac97f82b86063437cristy              channel_statistics[channel].minima=(double) p[i];
210f61a67f6bbdb636cece5542609e814f738b1e4e2cristy            break;
211f61a67f6bbdb636cece5542609e814f738b1e4e2cristy          }
212f61a67f6bbdb636cece5542609e814f738b1e4e2cristy        }
213f61a67f6bbdb636cece5542609e814f738b1e4e2cristy      }
214f61a67f6bbdb636cece5542609e814f738b1e4e2cristy      p+=GetPixelChannels(image);
215f61a67f6bbdb636cece5542609e814f738b1e4e2cristy    }
216f61a67f6bbdb636cece5542609e814f738b1e4e2cristy  }
217ab00885761fe5e51444ced72ac97f82b86063437cristy  return(channel_statistics);
218f61a67f6bbdb636cece5542609e814f738b1e4e2cristy}
219ab00885761fe5e51444ced72ac97f82b86063437cristy
22095a072b9674d607b5318a3283fd3952e82107828cristystatic ssize_t PrintChannelFeatures(FILE *file,const PixelChannel channel,
221e18977973bff5866de9aa6ed097aea40e27570d6cristy  const char *name,const ChannelFeatures *channel_features)
2223ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
223e18977973bff5866de9aa6ed097aea40e27570d6cristy#define PrintFeature(feature) \
224e18977973bff5866de9aa6ed097aea40e27570d6cristy  GetMagickPrecision(),(feature)[0], \
225e18977973bff5866de9aa6ed097aea40e27570d6cristy  GetMagickPrecision(),(feature)[1], \
226e18977973bff5866de9aa6ed097aea40e27570d6cristy  GetMagickPrecision(),(feature)[2], \
227e0acabf3ebf7da9eb716f98dfbbaa0d2f4d9d7e4cristy  GetMagickPrecision(),(feature)[3], \
228e0acabf3ebf7da9eb716f98dfbbaa0d2f4d9d7e4cristy  GetMagickPrecision(),((feature)[0]+(feature)[1]+(feature)[2]+(feature)[3])/4.0 \
229e18977973bff5866de9aa6ed097aea40e27570d6cristy
230bd82207b3816471fba4de916fca7336f38b70493cristy#define FeaturesFormat "    %s:\n" \
231cdf8e1b14a1280a464eeaa3c8b37b8ece8b9cdb2cristy  "      Angular Second Moment:\n" \
232e0acabf3ebf7da9eb716f98dfbbaa0d2f4d9d7e4cristy  "        %.*g, %.*g, %.*g, %.*g, %.*g\n" \
233cdf8e1b14a1280a464eeaa3c8b37b8ece8b9cdb2cristy  "      Contrast:\n" \
234e0acabf3ebf7da9eb716f98dfbbaa0d2f4d9d7e4cristy  "        %.*g, %.*g, %.*g, %.*g, %.*g\n" \
235cdf8e1b14a1280a464eeaa3c8b37b8ece8b9cdb2cristy  "      Correlation:\n" \
236e0acabf3ebf7da9eb716f98dfbbaa0d2f4d9d7e4cristy  "        %.*g, %.*g, %.*g, %.*g, %.*g\n" \
237a936dda9fefd135117c578bf1a2d8cfcb44bb867cristy  "      Sum of Squares Variance:\n" \
238e0acabf3ebf7da9eb716f98dfbbaa0d2f4d9d7e4cristy  "        %.*g, %.*g, %.*g, %.*g, %.*g\n" \
239cf5e649a2c6de215ffc88ee00987090773ba0722cristy  "      Inverse Difference Moment:\n" \
240e0acabf3ebf7da9eb716f98dfbbaa0d2f4d9d7e4cristy  "        %.*g, %.*g, %.*g, %.*g, %.*g\n" \
241e18977973bff5866de9aa6ed097aea40e27570d6cristy  "      Sum Average:\n" \
242e0acabf3ebf7da9eb716f98dfbbaa0d2f4d9d7e4cristy  "        %.*g, %.*g, %.*g, %.*g, %.*g\n" \
243e18977973bff5866de9aa6ed097aea40e27570d6cristy  "      Sum Variance:\n" \
244e0acabf3ebf7da9eb716f98dfbbaa0d2f4d9d7e4cristy  "        %.*g, %.*g, %.*g, %.*g, %.*g\n" \
245e18977973bff5866de9aa6ed097aea40e27570d6cristy  "      Sum Entropy:\n" \
246e0acabf3ebf7da9eb716f98dfbbaa0d2f4d9d7e4cristy  "        %.*g, %.*g, %.*g, %.*g, %.*g\n" \
247e18977973bff5866de9aa6ed097aea40e27570d6cristy  "      Entropy:\n" \
248e0acabf3ebf7da9eb716f98dfbbaa0d2f4d9d7e4cristy  "        %.*g, %.*g, %.*g, %.*g, %.*g\n" \
249e18977973bff5866de9aa6ed097aea40e27570d6cristy  "      Difference Variance:\n" \
250e0acabf3ebf7da9eb716f98dfbbaa0d2f4d9d7e4cristy  "        %.*g, %.*g, %.*g, %.*g, %.*g\n" \
251e0e19dc554957d2413f7fca5063a75fd92b8a12bcristy  "      Difference Entropy:\n" \
252e0acabf3ebf7da9eb716f98dfbbaa0d2f4d9d7e4cristy  "        %.*g, %.*g, %.*g, %.*g, %.*g\n" \
253e0e19dc554957d2413f7fca5063a75fd92b8a12bcristy  "      Information Measure of Correlation 1:\n" \
254e0acabf3ebf7da9eb716f98dfbbaa0d2f4d9d7e4cristy  "        %.*g, %.*g, %.*g, %.*g, %.*g\n" \
255e0e19dc554957d2413f7fca5063a75fd92b8a12bcristy  "      Information Measure of Correlation 2:\n" \
256e0acabf3ebf7da9eb716f98dfbbaa0d2f4d9d7e4cristy  "        %.*g, %.*g, %.*g, %.*g, %.*g\n" \
257e0e19dc554957d2413f7fca5063a75fd92b8a12bcristy  "      Maximum Correlation Coefficient:\n" \
258c3ec0d492d67fb2e45f079bf3da49d0448322d57cristy  "        %.*g, %.*g, %.*g, %.*g, %.*g\n"
259bd82207b3816471fba4de916fca7336f38b70493cristy
26020ec75933833a479a457aeb76c7f9338e1e1c093cristy  ssize_t
26120ec75933833a479a457aeb76c7f9338e1e1c093cristy    n;
262bd82207b3816471fba4de916fca7336f38b70493cristy
26320ec75933833a479a457aeb76c7f9338e1e1c093cristy  n=FormatLocaleFile(file,FeaturesFormat,name,
264e18977973bff5866de9aa6ed097aea40e27570d6cristy    PrintFeature(channel_features[channel].angular_second_moment),
265e18977973bff5866de9aa6ed097aea40e27570d6cristy    PrintFeature(channel_features[channel].contrast),
266e18977973bff5866de9aa6ed097aea40e27570d6cristy    PrintFeature(channel_features[channel].correlation),
267e18977973bff5866de9aa6ed097aea40e27570d6cristy    PrintFeature(channel_features[channel].variance_sum_of_squares),
268e18977973bff5866de9aa6ed097aea40e27570d6cristy    PrintFeature(channel_features[channel].inverse_difference_moment),
269e18977973bff5866de9aa6ed097aea40e27570d6cristy    PrintFeature(channel_features[channel].sum_average),
270e18977973bff5866de9aa6ed097aea40e27570d6cristy    PrintFeature(channel_features[channel].sum_variance),
271e18977973bff5866de9aa6ed097aea40e27570d6cristy    PrintFeature(channel_features[channel].sum_entropy),
272e18977973bff5866de9aa6ed097aea40e27570d6cristy    PrintFeature(channel_features[channel].entropy),
273e0e19dc554957d2413f7fca5063a75fd92b8a12bcristy    PrintFeature(channel_features[channel].difference_variance),
274e0e19dc554957d2413f7fca5063a75fd92b8a12bcristy    PrintFeature(channel_features[channel].difference_entropy),
275e0e19dc554957d2413f7fca5063a75fd92b8a12bcristy    PrintFeature(channel_features[channel].measure_of_correlation_1),
276e0e19dc554957d2413f7fca5063a75fd92b8a12bcristy    PrintFeature(channel_features[channel].measure_of_correlation_2),
277e0e19dc554957d2413f7fca5063a75fd92b8a12bcristy    PrintFeature(channel_features[channel].maximum_correlation_coefficient));
27820ec75933833a479a457aeb76c7f9338e1e1c093cristy  return(n);
279bd82207b3816471fba4de916fca7336f38b70493cristy}
280bd82207b3816471fba4de916fca7336f38b70493cristy
2817d8529e089faadb7c096e4514a222623d84eb093cristystatic ssize_t PrintChannelLocations(FILE *file,const Image *image,
282ab00885761fe5e51444ced72ac97f82b86063437cristy  const PixelChannel channel,const char *name,const StatisticType type,
283ab00885761fe5e51444ced72ac97f82b86063437cristy  const size_t max_locations,const ChannelStatistics *channel_statistics)
2847d8529e089faadb7c096e4514a222623d84eb093cristy{
285ab00885761fe5e51444ced72ac97f82b86063437cristy  double
286ab00885761fe5e51444ced72ac97f82b86063437cristy    target;
287ab00885761fe5e51444ced72ac97f82b86063437cristy
2887d8529e089faadb7c096e4514a222623d84eb093cristy  ExceptionInfo
2897d8529e089faadb7c096e4514a222623d84eb093cristy    *exception;
2907d8529e089faadb7c096e4514a222623d84eb093cristy
2917d8529e089faadb7c096e4514a222623d84eb093cristy  ssize_t
2927d8529e089faadb7c096e4514a222623d84eb093cristy    n,
2937d8529e089faadb7c096e4514a222623d84eb093cristy    y;
294858ba70b769abef55a70a5a8b42b54a053e4b5dbcristy
295ab00885761fe5e51444ced72ac97f82b86063437cristy  switch (type)
296ab00885761fe5e51444ced72ac97f82b86063437cristy  {
297ab00885761fe5e51444ced72ac97f82b86063437cristy    case MaximumStatistic:
298ab00885761fe5e51444ced72ac97f82b86063437cristy    default:
299ab00885761fe5e51444ced72ac97f82b86063437cristy    {
300ab00885761fe5e51444ced72ac97f82b86063437cristy      target=channel_statistics[channel].maxima;
301ab00885761fe5e51444ced72ac97f82b86063437cristy      break;
302ab00885761fe5e51444ced72ac97f82b86063437cristy    }
303ab00885761fe5e51444ced72ac97f82b86063437cristy    case MinimumStatistic:
304ab00885761fe5e51444ced72ac97f82b86063437cristy    {
305ab00885761fe5e51444ced72ac97f82b86063437cristy      target=channel_statistics[channel].minima;
306ab00885761fe5e51444ced72ac97f82b86063437cristy      break;
307ab00885761fe5e51444ced72ac97f82b86063437cristy    }
308ab00885761fe5e51444ced72ac97f82b86063437cristy  }
3094ead6fc4dfa181b8efc41a31b4a7b664a3ffdecfcristy  (void) FormatLocaleFile(file,"  %s: %.*g (%.*g)",name,GetMagickPrecision(),
310ab00885761fe5e51444ced72ac97f82b86063437cristy    target,GetMagickPrecision(),QuantumScale*target);
3117d8529e089faadb7c096e4514a222623d84eb093cristy  exception=AcquireExceptionInfo();
3127d8529e089faadb7c096e4514a222623d84eb093cristy  n=0;
3137d8529e089faadb7c096e4514a222623d84eb093cristy  for (y=0; y < (ssize_t) image->rows; y++)
3147d8529e089faadb7c096e4514a222623d84eb093cristy  {
3157d8529e089faadb7c096e4514a222623d84eb093cristy    register const Quantum
3167d8529e089faadb7c096e4514a222623d84eb093cristy      *p;
3177d8529e089faadb7c096e4514a222623d84eb093cristy
3187d8529e089faadb7c096e4514a222623d84eb093cristy    ssize_t
319ab00885761fe5e51444ced72ac97f82b86063437cristy      offset,
3207d8529e089faadb7c096e4514a222623d84eb093cristy      x;
3217d8529e089faadb7c096e4514a222623d84eb093cristy
3227d8529e089faadb7c096e4514a222623d84eb093cristy    p=GetVirtualPixels(image,0,y,image->columns,1,exception);
3237d8529e089faadb7c096e4514a222623d84eb093cristy    if (p == (const Quantum *) NULL)
3247d8529e089faadb7c096e4514a222623d84eb093cristy      break;
3257d8529e089faadb7c096e4514a222623d84eb093cristy    for (x=0; x < (ssize_t) image->columns; x++)
3267d8529e089faadb7c096e4514a222623d84eb093cristy    {
3277d8529e089faadb7c096e4514a222623d84eb093cristy      MagickBooleanType
3287d8529e089faadb7c096e4514a222623d84eb093cristy        match;
3297d8529e089faadb7c096e4514a222623d84eb093cristy
3307d8529e089faadb7c096e4514a222623d84eb093cristy      PixelTrait traits=GetPixelChannelTraits(image,channel);
3317d8529e089faadb7c096e4514a222623d84eb093cristy      if (traits == UndefinedPixelTrait)
3327d8529e089faadb7c096e4514a222623d84eb093cristy        continue;
333ab00885761fe5e51444ced72ac97f82b86063437cristy      offset=GetPixelChannelOffset(image,channel);
3343bdd925dbb0804df99e548c50667670319655816cristy      match=fabs((double) (p[offset]-target)) < 0.5 ? MagickTrue : MagickFalse;
3357d8529e089faadb7c096e4514a222623d84eb093cristy      if (match != MagickFalse)
3367d8529e089faadb7c096e4514a222623d84eb093cristy        {
337220c4d505bfb9cf557e8ec1616d7cdc0596379b8cristy          if ((max_locations != 0) && (n >= (ssize_t) max_locations))
3387d8529e089faadb7c096e4514a222623d84eb093cristy            break;
3394ead6fc4dfa181b8efc41a31b4a7b664a3ffdecfcristy          (void) FormatLocaleFile(file," %.20g,%.20g",(double) x,(double) y);
3407d8529e089faadb7c096e4514a222623d84eb093cristy          n++;
3417d8529e089faadb7c096e4514a222623d84eb093cristy        }
342858ba70b769abef55a70a5a8b42b54a053e4b5dbcristy      p+=GetPixelChannels(image);
3437d8529e089faadb7c096e4514a222623d84eb093cristy    }
3447d8529e089faadb7c096e4514a222623d84eb093cristy    if (x < (ssize_t) image->columns)
3457d8529e089faadb7c096e4514a222623d84eb093cristy      break;
3467d8529e089faadb7c096e4514a222623d84eb093cristy  }
3477d8529e089faadb7c096e4514a222623d84eb093cristy  (void) FormatLocaleFile(file,"\n");
3487d8529e089faadb7c096e4514a222623d84eb093cristy  return(n);
3497d8529e089faadb7c096e4514a222623d84eb093cristy}
3507d8529e089faadb7c096e4514a222623d84eb093cristy
351bd4a3c228c0e785517b8ab630b2cc6095373f710cristystatic ssize_t PrintChannelMoments(FILE *file,const PixelChannel channel,
352cb9af4ac6134e7e15e7d344489e9e0f634e1b4c1cristy  const char *name,const double scale,const ChannelMoments *channel_moments)
353bd4a3c228c0e785517b8ab630b2cc6095373f710cristy{
354cb9af4ac6134e7e15e7d344489e9e0f634e1b4c1cristy  double
35563101819bfb2732d188f08f9d55b2434a0fbd41acristy    powers[MaximumNumberOfImageMoments] =
35663101819bfb2732d188f08f9d55b2434a0fbd41acristy      { 1.0, 2.0, 3.0, 3.0, 6.0, 4.0, 6.0, 4.0 };
357cb9af4ac6134e7e15e7d344489e9e0f634e1b4c1cristy
35889298f3c13624feaa1c88ace47e4c728ea9d1fb0cristy  register ssize_t
35989298f3c13624feaa1c88ace47e4c728ea9d1fb0cristy    i;
36089298f3c13624feaa1c88ace47e4c728ea9d1fb0cristy
361bd4a3c228c0e785517b8ab630b2cc6095373f710cristy  ssize_t
362bd4a3c228c0e785517b8ab630b2cc6095373f710cristy    n;
363bd4a3c228c0e785517b8ab630b2cc6095373f710cristy
36489298f3c13624feaa1c88ace47e4c728ea9d1fb0cristy  n=FormatLocaleFile(file,"    %s:\n",name);
36589298f3c13624feaa1c88ace47e4c728ea9d1fb0cristy  n+=FormatLocaleFile(file,"      Centroid: %.*g,%.*g\n",
36689298f3c13624feaa1c88ace47e4c728ea9d1fb0cristy    GetMagickPrecision(),channel_moments[channel].centroid.x,
36789298f3c13624feaa1c88ace47e4c728ea9d1fb0cristy    GetMagickPrecision(),channel_moments[channel].centroid.y);
36889298f3c13624feaa1c88ace47e4c728ea9d1fb0cristy  n+=FormatLocaleFile(file,"      Ellipse Semi-Major/Minor axis: %.*g,%.*g\n",
36989298f3c13624feaa1c88ace47e4c728ea9d1fb0cristy    GetMagickPrecision(),channel_moments[channel].ellipse_axis.x,
37089298f3c13624feaa1c88ace47e4c728ea9d1fb0cristy    GetMagickPrecision(),channel_moments[channel].ellipse_axis.y);
37189298f3c13624feaa1c88ace47e4c728ea9d1fb0cristy  n+=FormatLocaleFile(file,"      Ellipse angle: %.*g\n",
37289298f3c13624feaa1c88ace47e4c728ea9d1fb0cristy    GetMagickPrecision(),channel_moments[channel].ellipse_angle);
37389298f3c13624feaa1c88ace47e4c728ea9d1fb0cristy  n+=FormatLocaleFile(file,"      Ellipse eccentricity: %.*g\n",
37489298f3c13624feaa1c88ace47e4c728ea9d1fb0cristy    GetMagickPrecision(),channel_moments[channel].ellipse_eccentricity);
375cb9af4ac6134e7e15e7d344489e9e0f634e1b4c1cristy  n+=FormatLocaleFile(file,"      Ellipse intensity: %.*g (%.*g)\n",
376cb9af4ac6134e7e15e7d344489e9e0f634e1b4c1cristy    GetMagickPrecision(),pow(scale,powers[0])*
377cb9af4ac6134e7e15e7d344489e9e0f634e1b4c1cristy    channel_moments[channel].ellipse_intensity,GetMagickPrecision(),
378cb9af4ac6134e7e15e7d344489e9e0f634e1b4c1cristy    channel_moments[channel].ellipse_intensity);
3793ac6aa903557af75f8149bad7c8aa512158fa445cristy  for (i=0; i < MaximumNumberOfImageMoments; i++)
380cb9af4ac6134e7e15e7d344489e9e0f634e1b4c1cristy    n+=FormatLocaleFile(file,"      I%.20g: %.*g (%.*g)\n",i+1.0,
38157f71289ef12fb275c908972156e7e397d9e07bbcristy      GetMagickPrecision(),channel_moments[channel].invariant[i]/pow(scale,
38257f71289ef12fb275c908972156e7e397d9e07bbcristy      powers[i]),GetMagickPrecision(),channel_moments[channel].invariant[i]);
383bd4a3c228c0e785517b8ab630b2cc6095373f710cristy  return(n);
384bd4a3c228c0e785517b8ab630b2cc6095373f710cristy}
385bd4a3c228c0e785517b8ab630b2cc6095373f710cristy
386362243dce471998f0685428c4238c3d69421a2b0cristystatic ssize_t PrintChannelPerceptualHash(FILE *file,const PixelChannel channel,
387b3538ec3d53d5853f18e99b510cd855ac870c281cristy  const char *name,const ChannelPerceptualHash *channel_phash)
388b3538ec3d53d5853f18e99b510cd855ac870c281cristy{
389b3538ec3d53d5853f18e99b510cd855ac870c281cristy  register ssize_t
390b3538ec3d53d5853f18e99b510cd855ac870c281cristy    i;
391b3538ec3d53d5853f18e99b510cd855ac870c281cristy
392b3538ec3d53d5853f18e99b510cd855ac870c281cristy  ssize_t
393b3538ec3d53d5853f18e99b510cd855ac870c281cristy    n;
394b3538ec3d53d5853f18e99b510cd855ac870c281cristy
395b3538ec3d53d5853f18e99b510cd855ac870c281cristy  n=FormatLocaleFile(file,"    %s:\n",name);
3964cc7ead1c167fc5f78960398c588d8941165b61ccristy  for (i=0; i < MaximumNumberOfPerceptualHashes; i++)
3976808a80606d300a5e5fe0fece9e4b82e0dad61abcristy    n+=FormatLocaleFile(file,"      PH%.20g: %.*g, %.*g\n",i+1.0,
398c018762fb6f380c9d0b1057ec2390e7422ab5178cristy      GetMagickPrecision(),channel_phash[channel].srgb_hu_phash[i],
399c018762fb6f380c9d0b1057ec2390e7422ab5178cristy      GetMagickPrecision(),channel_phash[channel].hclp_hu_phash[i]);
400b3538ec3d53d5853f18e99b510cd855ac870c281cristy  return(n);
401b3538ec3d53d5853f18e99b510cd855ac870c281cristy}
402b3538ec3d53d5853f18e99b510cd855ac870c281cristy
40395a072b9674d607b5318a3283fd3952e82107828cristystatic ssize_t PrintChannelStatistics(FILE *file,const PixelChannel channel,
404bd82207b3816471fba4de916fca7336f38b70493cristy  const char *name,const double scale,
405bd82207b3816471fba4de916fca7336f38b70493cristy  const ChannelStatistics *channel_statistics)
406bd82207b3816471fba4de916fca7336f38b70493cristy{
407bd82207b3816471fba4de916fca7336f38b70493cristy#define StatisticsFormat "    %s:\n      min: " QuantumFormat  \
408e7f5109f30fc7242d04a26174a9138483dda5b6acristy  " (%g)\n      max: " QuantumFormat " (%g)\n"  \
409e7f5109f30fc7242d04a26174a9138483dda5b6acristy  "      mean: %g (%g)\n      standard deviation: %g (%g)\n"  \
41081c3360b2dfd109013aa2116eeb3a3caa29dd362cristy  "      kurtosis: %g\n      skewness: %g\n      entropy: %g\n"
4113ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
41220ec75933833a479a457aeb76c7f9338e1e1c093cristy  ssize_t
41320ec75933833a479a457aeb76c7f9338e1e1c093cristy    n;
414bd82207b3816471fba4de916fca7336f38b70493cristy
4158f424002488d9f5ece29228d8ede0e39d838f38bCristy  n=FormatLocaleFile(file,StatisticsFormat,name,ClampToQuantum((MagickRealType)
4168f424002488d9f5ece29228d8ede0e39d838f38bCristy    (scale*channel_statistics[channel].minima)),
4178f424002488d9f5ece29228d8ede0e39d838f38bCristy    channel_statistics[channel].minima/(double) QuantumRange,ClampToQuantum(
4188f424002488d9f5ece29228d8ede0e39d838f38bCristy    (MagickRealType) (scale*channel_statistics[channel].maxima)),
4198f424002488d9f5ece29228d8ede0e39d838f38bCristy    channel_statistics[channel].maxima/(double) QuantumRange,scale*
4208f424002488d9f5ece29228d8ede0e39d838f38bCristy    channel_statistics[channel].mean,channel_statistics[channel].mean/(double)
4218f424002488d9f5ece29228d8ede0e39d838f38bCristy    QuantumRange,scale*channel_statistics[channel].standard_deviation,
42275b5a2524fcf8e17a411b92fa09b95a35a172c93cristy    channel_statistics[channel].standard_deviation/(double) QuantumRange,
42381c3360b2dfd109013aa2116eeb3a3caa29dd362cristy    channel_statistics[channel].kurtosis,channel_statistics[channel].skewness,
42481c3360b2dfd109013aa2116eeb3a3caa29dd362cristy    channel_statistics[channel].entropy);
42520ec75933833a479a457aeb76c7f9338e1e1c093cristy  return(n);
426bd82207b3816471fba4de916fca7336f38b70493cristy}
427bd82207b3816471fba4de916fca7336f38b70493cristy
428bd82207b3816471fba4de916fca7336f38b70493cristyMagickExport MagickBooleanType IdentifyImage(Image *image,FILE *file,
429a403727ea73ef5840a476a3c4614445807f42827cristy  const MagickBooleanType verbose,ExceptionInfo *exception)
430bd82207b3816471fba4de916fca7336f38b70493cristy{
4313ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  char
432151b66dffc9e3c2e8c4f8cdaca37ff987ca0f497cristy    color[MagickPathExtent],
433151b66dffc9e3c2e8c4f8cdaca37ff987ca0f497cristy    format[MagickPathExtent],
434151b66dffc9e3c2e8c4f8cdaca37ff987ca0f497cristy    key[MagickPathExtent];
4353ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
436bd82207b3816471fba4de916fca7336f38b70493cristy  ChannelFeatures
437bd82207b3816471fba4de916fca7336f38b70493cristy    *channel_features;
438bd82207b3816471fba4de916fca7336f38b70493cristy
439bd4a3c228c0e785517b8ab630b2cc6095373f710cristy  ChannelMoments
440bd4a3c228c0e785517b8ab630b2cc6095373f710cristy    *channel_moments;
441bd4a3c228c0e785517b8ab630b2cc6095373f710cristy
442b3538ec3d53d5853f18e99b510cd855ac870c281cristy  ChannelPerceptualHash
443b3538ec3d53d5853f18e99b510cd855ac870c281cristy    *channel_phash;
444b3538ec3d53d5853f18e99b510cd855ac870c281cristy
445bd82207b3816471fba4de916fca7336f38b70493cristy  ChannelStatistics
446bd82207b3816471fba4de916fca7336f38b70493cristy    *channel_statistics;
447bd82207b3816471fba4de916fca7336f38b70493cristy
4483ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  ColorspaceType
4493ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    colorspace;
4503ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
4513ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  const char
4523ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    *artifact,
4537d8529e089faadb7c096e4514a222623d84eb093cristy    *locate,
4543ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    *name,
4553ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    *property,
4563ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    *registry,
4573ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    *value;
4583ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
4593ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  const MagickInfo
4603ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    *magick_info;
4613ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
4623ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  double
4633ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    elapsed_time,
464cb9af4ac6134e7e15e7d344489e9e0f634e1b4c1cristy    scale,
4653ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    user_time;
4663ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
4673ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  ImageType
468ab4f0bb4e2c2d3e3e61408499755fa710f15e18fdirk    base_type,
4693ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    type;
4703ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
4713ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  MagickBooleanType
4723ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    ping;
4733ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
4744c08aed51c5899665ade97263692328eea4af106cristy  register const Quantum
4754c08aed51c5899665ade97263692328eea4af106cristy    *p;
4764c08aed51c5899665ade97263692328eea4af106cristy
477bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy  register ssize_t
4783ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    i,
4793ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    x;
4803ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
481bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy  size_t
482cb9af4ac6134e7e15e7d344489e9e0f634e1b4c1cristy    distance;
4833ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
4849d314ff2c17a77996c05413c2013880387e50f0ecristy  ssize_t
4859d314ff2c17a77996c05413c2013880387e50f0ecristy    y;
4869d314ff2c17a77996c05413c2013880387e50f0ecristy
4873ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  assert(image != (Image *) NULL);
488e1c94d9d25db6b0dd7a5028ffee31d1057855d73cristy  assert(image->signature == MagickCoreSignature);
4893ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  if (image->debug != MagickFalse)
4903ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
4913ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  if (file == (FILE *) NULL)
4923ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    file=stdout;
493ab4f0bb4e2c2d3e3e61408499755fa710f15e18fdirk  colorspace=image->colorspace;
494ab4f0bb4e2c2d3e3e61408499755fa710f15e18fdirk  type=IdentifyImageType(image,exception);
495ab4f0bb4e2c2d3e3e61408499755fa710f15e18fdirk  if ((type == BilevelType) || (type == GrayscaleType) ||
496ab4f0bb4e2c2d3e3e61408499755fa710f15e18fdirk      (type == GrayscaleAlphaType))
497ab4f0bb4e2c2d3e3e61408499755fa710f15e18fdirk    colorspace=GRAYColorspace;
4984ead6fc4dfa181b8efc41a31b4a7b664a3ffdecfcristy  locate=GetImageArtifact(image,"identify:locate");
4994ead6fc4dfa181b8efc41a31b4a7b664a3ffdecfcristy  if (locate != (const char *) NULL)
5004ead6fc4dfa181b8efc41a31b4a7b664a3ffdecfcristy    {
5014ead6fc4dfa181b8efc41a31b4a7b664a3ffdecfcristy      const char
5024ead6fc4dfa181b8efc41a31b4a7b664a3ffdecfcristy        *limit;
5034ead6fc4dfa181b8efc41a31b4a7b664a3ffdecfcristy
5044ead6fc4dfa181b8efc41a31b4a7b664a3ffdecfcristy      size_t
5054ead6fc4dfa181b8efc41a31b4a7b664a3ffdecfcristy        max_locations;
5064ead6fc4dfa181b8efc41a31b4a7b664a3ffdecfcristy
5074ead6fc4dfa181b8efc41a31b4a7b664a3ffdecfcristy      StatisticType
5084ead6fc4dfa181b8efc41a31b4a7b664a3ffdecfcristy        type;
5094ead6fc4dfa181b8efc41a31b4a7b664a3ffdecfcristy
5104ead6fc4dfa181b8efc41a31b4a7b664a3ffdecfcristy      /*
5114ead6fc4dfa181b8efc41a31b4a7b664a3ffdecfcristy        Display minimum, maximum, or mean pixel locations.
5124ead6fc4dfa181b8efc41a31b4a7b664a3ffdecfcristy      */
5134ead6fc4dfa181b8efc41a31b4a7b664a3ffdecfcristy      type=(StatisticType) ParseCommandOption(MagickStatisticOptions,
5144ead6fc4dfa181b8efc41a31b4a7b664a3ffdecfcristy        MagickFalse,locate);
5154ead6fc4dfa181b8efc41a31b4a7b664a3ffdecfcristy      limit=GetImageArtifact(image,"identify:limit");
5164ead6fc4dfa181b8efc41a31b4a7b664a3ffdecfcristy      max_locations=0;
5174ead6fc4dfa181b8efc41a31b4a7b664a3ffdecfcristy      if (limit != (const char *) NULL)
5184ead6fc4dfa181b8efc41a31b4a7b664a3ffdecfcristy        max_locations=StringToUnsignedLong(limit);
5194ead6fc4dfa181b8efc41a31b4a7b664a3ffdecfcristy      channel_statistics=GetLocationStatistics(image,type,exception);
5204ead6fc4dfa181b8efc41a31b4a7b664a3ffdecfcristy      if (channel_statistics == (ChannelStatistics *) NULL)
5214ead6fc4dfa181b8efc41a31b4a7b664a3ffdecfcristy        return(MagickFalse);
5224ead6fc4dfa181b8efc41a31b4a7b664a3ffdecfcristy      (void) FormatLocaleFile(file,"Channel %s locations:\n",locate);
5234ead6fc4dfa181b8efc41a31b4a7b664a3ffdecfcristy      switch (colorspace)
5244ead6fc4dfa181b8efc41a31b4a7b664a3ffdecfcristy      {
5254ead6fc4dfa181b8efc41a31b4a7b664a3ffdecfcristy        case RGBColorspace:
5264ead6fc4dfa181b8efc41a31b4a7b664a3ffdecfcristy        default:
5274ead6fc4dfa181b8efc41a31b4a7b664a3ffdecfcristy        {
5284ead6fc4dfa181b8efc41a31b4a7b664a3ffdecfcristy          (void) PrintChannelLocations(file,image,RedPixelChannel,"Red",
5294ead6fc4dfa181b8efc41a31b4a7b664a3ffdecfcristy            type,max_locations,channel_statistics);
5304ead6fc4dfa181b8efc41a31b4a7b664a3ffdecfcristy          (void) PrintChannelLocations(file,image,GreenPixelChannel,"Green",
5314ead6fc4dfa181b8efc41a31b4a7b664a3ffdecfcristy            type,max_locations,channel_statistics);
5324ead6fc4dfa181b8efc41a31b4a7b664a3ffdecfcristy          (void) PrintChannelLocations(file,image,BluePixelChannel,"Blue",
5334ead6fc4dfa181b8efc41a31b4a7b664a3ffdecfcristy            type,max_locations,channel_statistics);
5344ead6fc4dfa181b8efc41a31b4a7b664a3ffdecfcristy          break;
5354ead6fc4dfa181b8efc41a31b4a7b664a3ffdecfcristy        }
5364ead6fc4dfa181b8efc41a31b4a7b664a3ffdecfcristy        case CMYKColorspace:
5374ead6fc4dfa181b8efc41a31b4a7b664a3ffdecfcristy        {
5384ead6fc4dfa181b8efc41a31b4a7b664a3ffdecfcristy          (void) PrintChannelLocations(file,image,CyanPixelChannel,"Cyan",
5394ead6fc4dfa181b8efc41a31b4a7b664a3ffdecfcristy            type,max_locations,channel_statistics);
5404ead6fc4dfa181b8efc41a31b4a7b664a3ffdecfcristy          (void) PrintChannelLocations(file,image,MagentaPixelChannel,"Magenta",
5414ead6fc4dfa181b8efc41a31b4a7b664a3ffdecfcristy            type,max_locations,channel_statistics);
5424ead6fc4dfa181b8efc41a31b4a7b664a3ffdecfcristy          (void) PrintChannelLocations(file,image,YellowPixelChannel,"Yellow",
5434ead6fc4dfa181b8efc41a31b4a7b664a3ffdecfcristy            type,max_locations,channel_statistics);
5444ead6fc4dfa181b8efc41a31b4a7b664a3ffdecfcristy          (void) PrintChannelLocations(file,image,BlackPixelChannel,"Black",
5454ead6fc4dfa181b8efc41a31b4a7b664a3ffdecfcristy            type,max_locations,channel_statistics);
5464ead6fc4dfa181b8efc41a31b4a7b664a3ffdecfcristy          break;
5474ead6fc4dfa181b8efc41a31b4a7b664a3ffdecfcristy        }
5484ead6fc4dfa181b8efc41a31b4a7b664a3ffdecfcristy        case GRAYColorspace:
5494ead6fc4dfa181b8efc41a31b4a7b664a3ffdecfcristy        {
5504ead6fc4dfa181b8efc41a31b4a7b664a3ffdecfcristy          (void) PrintChannelLocations(file,image,GrayPixelChannel,"Gray",
5514ead6fc4dfa181b8efc41a31b4a7b664a3ffdecfcristy            type,max_locations,channel_statistics);
5524ead6fc4dfa181b8efc41a31b4a7b664a3ffdecfcristy          break;
5534ead6fc4dfa181b8efc41a31b4a7b664a3ffdecfcristy        }
5544ead6fc4dfa181b8efc41a31b4a7b664a3ffdecfcristy      }
55517f11b056210f082a6d0e54ac5d68e6d72fa76b2cristy      if (image->alpha_trait != UndefinedPixelTrait)
5564ead6fc4dfa181b8efc41a31b4a7b664a3ffdecfcristy        (void) PrintChannelLocations(file,image,AlphaPixelChannel,"Alpha",
5574ead6fc4dfa181b8efc41a31b4a7b664a3ffdecfcristy          type,max_locations,channel_statistics);
5584ead6fc4dfa181b8efc41a31b4a7b664a3ffdecfcristy      channel_statistics=(ChannelStatistics *) RelinquishMagickMemory(
5594ead6fc4dfa181b8efc41a31b4a7b664a3ffdecfcristy        channel_statistics);
5604ead6fc4dfa181b8efc41a31b4a7b664a3ffdecfcristy      return(ferror(file) != 0 ? MagickFalse : MagickTrue);
5614ead6fc4dfa181b8efc41a31b4a7b664a3ffdecfcristy    }
5623ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  *format='\0';
5633ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  elapsed_time=GetElapsedTime(&image->timer);
5643ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  user_time=GetUserTime(&image->timer);
5653ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  GetTimerInfo(&image->timer);
5663ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  if (verbose == MagickFalse)
5673ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    {
5683ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      /*
5693ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        Display summary info about the image.
5703ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      */
5713ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      if (*image->magick_filename != '\0')
5723ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        if (LocaleCompare(image->magick_filename,image->filename) != 0)
573b51dff5c0d16a4c1b69ff683e786cb3b4c467694cristy          (void) FormatLocaleFile(file,"%s=>",image->magick_filename);
5743ed852eea50f9d4cd633efb8c2b054b8e33c253cristy       if ((GetPreviousImageInList(image) == (Image *) NULL) &&
57581b8ce50dd24e04819b472cd03b9181aa2f3799bcristy           (GetNextImageInList(image) == (Image *) NULL) &&
57681b8ce50dd24e04819b472cd03b9181aa2f3799bcristy           (image->scene == 0))
577b51dff5c0d16a4c1b69ff683e786cb3b4c467694cristy        (void) FormatLocaleFile(file,"%s ",image->filename);
5783ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      else
5791e604812fad85bb96f757a2393015ae3d061c39acristy        (void) FormatLocaleFile(file,"%s[%.20g] ",image->filename,(double)
5801e604812fad85bb96f757a2393015ae3d061c39acristy          image->scene);
581b51dff5c0d16a4c1b69ff683e786cb3b4c467694cristy      (void) FormatLocaleFile(file,"%s ",image->magick);
5823ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      if ((image->magick_columns != 0) || (image->magick_rows != 0))
5833ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        if ((image->magick_columns != image->columns) ||
5843ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            (image->magick_rows != image->rows))
5851e604812fad85bb96f757a2393015ae3d061c39acristy          (void) FormatLocaleFile(file,"%.20gx%.20g=>",(double)
5861e604812fad85bb96f757a2393015ae3d061c39acristy            image->magick_columns,(double) image->magick_rows);
5871e604812fad85bb96f757a2393015ae3d061c39acristy      (void) FormatLocaleFile(file,"%.20gx%.20g ",(double) image->columns,
5881e604812fad85bb96f757a2393015ae3d061c39acristy        (double) image->rows);
5893ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      if ((image->page.width != 0) || (image->page.height != 0) ||
5903ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          (image->page.x != 0) || (image->page.y != 0))
591b51dff5c0d16a4c1b69ff683e786cb3b4c467694cristy        (void) FormatLocaleFile(file,"%.20gx%.20g%+.20g%+.20g ",(double)
592e8c25f9b4c9fb72cad6db08eeda58c7c5784014ecristy          image->page.width,(double) image->page.height,(double) image->page.x,
593e8c25f9b4c9fb72cad6db08eeda58c7c5784014ecristy          (double) image->page.y);
594b51dff5c0d16a4c1b69ff683e786cb3b4c467694cristy      (void) FormatLocaleFile(file,"%.20g-bit ",(double) image->depth);
5955f1c1fff2a55c4d8756556e78c1f307d352ed1b8cristy      if (image->type != UndefinedType)
5961e604812fad85bb96f757a2393015ae3d061c39acristy        (void) FormatLocaleFile(file,"%s ",CommandOptionToMnemonic(
5971e604812fad85bb96f757a2393015ae3d061c39acristy          MagickTypeOptions,(ssize_t) image->type));
598ab00885761fe5e51444ced72ac97f82b86063437cristy      if (image->colorspace != UndefinedColorspace)
599479d462b5cac53bce755a44ed0916903d9c03c69cristy        (void) FormatLocaleFile(file,"%s ",CommandOptionToMnemonic(
600479d462b5cac53bce755a44ed0916903d9c03c69cristy          MagickColorspaceOptions,(ssize_t) image->colorspace));
6013ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      if (image->storage_class == DirectClass)
6023ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        {
6033ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          if (image->total_colors != 0)
6043ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            {
60540937044c58de334456bbfb2b6fed5ab03fd2946cristy              (void) FormatMagickSize(image->total_colors,MagickFalse,"B",
606151b66dffc9e3c2e8c4f8cdaca37ff987ca0f497cristy                MagickPathExtent,format);
607b51dff5c0d16a4c1b69ff683e786cb3b4c467694cristy              (void) FormatLocaleFile(file,"%s ",format);
6083ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            }
6093ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        }
6103ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      else
6113ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        if (image->total_colors <= image->colors)
612479d462b5cac53bce755a44ed0916903d9c03c69cristy          (void) FormatLocaleFile(file,"%.20gc ",(double)
6131e604812fad85bb96f757a2393015ae3d061c39acristy            image->colors);
614f2faecf9facdbbb14fcba373365f9f691a9658e0cristy        else
615479d462b5cac53bce755a44ed0916903d9c03c69cristy          (void) FormatLocaleFile(file,"%.20g=>%.20gc ",(double)
616e8c25f9b4c9fb72cad6db08eeda58c7c5784014ecristy            image->total_colors,(double) image->colors);
6173ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      if (image->error.mean_error_per_pixel != 0.0)
618b51dff5c0d16a4c1b69ff683e786cb3b4c467694cristy        (void) FormatLocaleFile(file,"%.20g/%f/%fdb ",(double)
6193ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          (image->error.mean_error_per_pixel+0.5),
6203ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          image->error.normalized_mean_error,
6213ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          image->error.normalized_maximum_error);
6223ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      if (GetBlobSize(image) != 0)
6233ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        {
62440937044c58de334456bbfb2b6fed5ab03fd2946cristy          (void) FormatMagickSize(GetBlobSize(image),MagickFalse,"B",
625151b66dffc9e3c2e8c4f8cdaca37ff987ca0f497cristy            MagickPathExtent,format);
626b51dff5c0d16a4c1b69ff683e786cb3b4c467694cristy          (void) FormatLocaleFile(file,"%s ",format);
6273ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        }
6281e604812fad85bb96f757a2393015ae3d061c39acristy      (void) FormatLocaleFile(file,"%0.3fu %lu:%02lu.%03lu",user_time,
6291e604812fad85bb96f757a2393015ae3d061c39acristy        (unsigned long) (elapsed_time/60.0),(unsigned long) floor(fmod(
6301e604812fad85bb96f757a2393015ae3d061c39acristy        elapsed_time,60.0)),(unsigned long) (1000.0*(elapsed_time-
6311e604812fad85bb96f757a2393015ae3d061c39acristy        floor(elapsed_time))));
632b51dff5c0d16a4c1b69ff683e786cb3b4c467694cristy      (void) FormatLocaleFile(file,"\n");
6333ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      (void) fflush(file);
6343ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      return(ferror(file) != 0 ? MagickFalse : MagickTrue);
6353ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    }
6363ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  /*
6373ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    Display verbose info about the image.
6383ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  */
6394c08aed51c5899665ade97263692328eea4af106cristy  p=GetVirtualPixels(image,0,0,1,1,exception);
6404c08aed51c5899665ade97263692328eea4af106cristy  ping=p == (const Quantum *) NULL ? MagickTrue : MagickFalse;
641018f07f7333b25743d0afff892450cebdb905c1acristy  (void) SignatureImage(image,exception);
642b51dff5c0d16a4c1b69ff683e786cb3b4c467694cristy  (void) FormatLocaleFile(file,"Image: %s\n",image->filename);
6433ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  if (*image->magick_filename != '\0')
6443ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    if (LocaleCompare(image->magick_filename,image->filename) != 0)
6453ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      {
6463ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        char
647151b66dffc9e3c2e8c4f8cdaca37ff987ca0f497cristy          filename[MagickPathExtent];
6483ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
6493ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        GetPathComponent(image->magick_filename,TailPath,filename);
650b51dff5c0d16a4c1b69ff683e786cb3b4c467694cristy        (void) FormatLocaleFile(file,"  Base filename: %s\n",filename);
6513ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      }
652a403727ea73ef5840a476a3c4614445807f42827cristy  magick_info=GetMagickInfo(image->magick,exception);
6533ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  if ((magick_info == (const MagickInfo *) NULL) ||
6544a6ab48c16700894c266e4ee8b3eef0292b5801bcristy      (GetMagickDescription(magick_info) == (const char *) NULL))
655b51dff5c0d16a4c1b69ff683e786cb3b4c467694cristy    (void) FormatLocaleFile(file,"  Format: %s\n",image->magick);
6563ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  else
657b51dff5c0d16a4c1b69ff683e786cb3b4c467694cristy    (void) FormatLocaleFile(file,"  Format: %s (%s)\n",image->magick,
6583ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      GetMagickDescription(magick_info));
65973e5e027fe82576128c6ddebce1b47d100469845cristy  if ((magick_info != (const MagickInfo *) NULL) &&
6604a6ab48c16700894c266e4ee8b3eef0292b5801bcristy      (GetMagickMimeType(magick_info) != (const char *) NULL))
6614a6ab48c16700894c266e4ee8b3eef0292b5801bcristy    (void) FormatLocaleFile(file,"  Mime type: %s\n",GetMagickMimeType(
6625558495709596372c045ee14f056aaa44ddc8db0dirk      magick_info));
6631e604812fad85bb96f757a2393015ae3d061c39acristy  (void) FormatLocaleFile(file,"  Class: %s\n",CommandOptionToMnemonic(
6641e604812fad85bb96f757a2393015ae3d061c39acristy    MagickClassOptions,(ssize_t) image->storage_class));
665b51dff5c0d16a4c1b69ff683e786cb3b4c467694cristy  (void) FormatLocaleFile(file,"  Geometry: %.20gx%.20g%+.20g%+.20g\n",(double)
666e8c25f9b4c9fb72cad6db08eeda58c7c5784014ecristy    image->columns,(double) image->rows,(double) image->tile_offset.x,(double)
667e8c25f9b4c9fb72cad6db08eeda58c7c5784014ecristy    image->tile_offset.y);
6683ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  if ((image->magick_columns != 0) || (image->magick_rows != 0))
6693ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    if ((image->magick_columns != image->columns) ||
6703ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        (image->magick_rows != image->rows))
671b51dff5c0d16a4c1b69ff683e786cb3b4c467694cristy      (void) FormatLocaleFile(file,"  Base geometry: %.20gx%.20g\n",(double)
672e8c25f9b4c9fb72cad6db08eeda58c7c5784014ecristy        image->magick_columns,(double) image->magick_rows);
6732a11befa48257796843468409d77bb8cfb129cdccristy  if ((image->resolution.x != 0.0) && (image->resolution.y != 0.0))
6743ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    {
6752a11befa48257796843468409d77bb8cfb129cdccristy      (void) FormatLocaleFile(file,"  Resolution: %gx%g\n",image->resolution.x,
6762a11befa48257796843468409d77bb8cfb129cdccristy        image->resolution.y);
6771e604812fad85bb96f757a2393015ae3d061c39acristy      (void) FormatLocaleFile(file,"  Print size: %gx%g\n",(double)
6782a11befa48257796843468409d77bb8cfb129cdccristy        image->columns/image->resolution.x,(double) image->rows/
6792a11befa48257796843468409d77bb8cfb129cdccristy        image->resolution.y);
6803ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    }
681b51dff5c0d16a4c1b69ff683e786cb3b4c467694cristy  (void) FormatLocaleFile(file,"  Units: %s\n",CommandOptionToMnemonic(
682bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy    MagickResolutionOptions,(ssize_t) image->units));
6831e604812fad85bb96f757a2393015ae3d061c39acristy  (void) FormatLocaleFile(file,"  Type: %s\n",CommandOptionToMnemonic(
6841e604812fad85bb96f757a2393015ae3d061c39acristy    MagickTypeOptions,(ssize_t) type));
685ab4f0bb4e2c2d3e3e61408499755fa710f15e18fdirk  base_type=GetImageType(image);
686ab4f0bb4e2c2d3e3e61408499755fa710f15e18fdirk  if (type != base_type)
687b51dff5c0d16a4c1b69ff683e786cb3b4c467694cristy    (void) FormatLocaleFile(file,"  Base type: %s\n",CommandOptionToMnemonic(
688ab4f0bb4e2c2d3e3e61408499755fa710f15e18fdirk      MagickTypeOptions,(ssize_t) base_type));
689b51dff5c0d16a4c1b69ff683e786cb3b4c467694cristy  (void) FormatLocaleFile(file,"  Endianess: %s\n",CommandOptionToMnemonic(
690bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy    MagickEndianOptions,(ssize_t) image->endian));
6913ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  /*
6923ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    Detail channel depth and extrema.
6933ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  */
694b51dff5c0d16a4c1b69ff683e786cb3b4c467694cristy  (void) FormatLocaleFile(file,"  Colorspace: %s\n",CommandOptionToMnemonic(
695bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy    MagickColorspaceOptions,(ssize_t) image->colorspace));
696bd82207b3816471fba4de916fca7336f38b70493cristy  channel_statistics=(ChannelStatistics *) NULL;
697bd4a3c228c0e785517b8ab630b2cc6095373f710cristy  channel_moments=(ChannelMoments *) NULL;
698b3538ec3d53d5853f18e99b510cd855ac870c281cristy  channel_phash=(ChannelPerceptualHash *) NULL;
69915a88784c852291054bf90cb761449504b5327d8cristy  channel_features=(ChannelFeatures *) NULL;
700cb9af4ac6134e7e15e7d344489e9e0f634e1b4c1cristy  scale=1.0;
7013ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  if (ping == MagickFalse)
7023ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    {
703bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy      size_t
7043ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        depth;
7053ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
706a403727ea73ef5840a476a3c4614445807f42827cristy      channel_statistics=GetImageStatistics(image,exception);
707e287bbaee17bb627af090e3127082e5a316337e5cristy      if (channel_statistics == (ChannelStatistics *) NULL)
708e287bbaee17bb627af090e3127082e5a316337e5cristy        return(MagickFalse);
709bd4a3c228c0e785517b8ab630b2cc6095373f710cristy      artifact=GetImageArtifact(image,"identify:moments");
710bd4a3c228c0e785517b8ab630b2cc6095373f710cristy      if (artifact != (const char *) NULL)
711b3538ec3d53d5853f18e99b510cd855ac870c281cristy        {
712b3538ec3d53d5853f18e99b510cd855ac870c281cristy          channel_moments=GetImageMoments(image,exception);
713b3538ec3d53d5853f18e99b510cd855ac870c281cristy          channel_phash=GetImagePerceptualHash(image,exception);
714b3538ec3d53d5853f18e99b510cd855ac870c281cristy        }
71515a88784c852291054bf90cb761449504b5327d8cristy      artifact=GetImageArtifact(image,"identify:features");
71615a88784c852291054bf90cb761449504b5327d8cristy      if (artifact != (const char *) NULL)
71715a88784c852291054bf90cb761449504b5327d8cristy        {
71815a88784c852291054bf90cb761449504b5327d8cristy          distance=StringToUnsignedLong(artifact);
719a403727ea73ef5840a476a3c4614445807f42827cristy          channel_features=GetImageFeatures(image,distance,exception);
72015a88784c852291054bf90cb761449504b5327d8cristy        }
721a403727ea73ef5840a476a3c4614445807f42827cristy      depth=GetImageDepth(image,exception);
7223ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      if (image->depth == depth)
7231e604812fad85bb96f757a2393015ae3d061c39acristy        (void) FormatLocaleFile(file,"  Depth: %.20g-bit\n",(double)
7241e604812fad85bb96f757a2393015ae3d061c39acristy          image->depth);
7253ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      else
726b51dff5c0d16a4c1b69ff683e786cb3b4c467694cristy        (void) FormatLocaleFile(file,"  Depth: %.20g/%.20g-bit\n",(double)
727e8c25f9b4c9fb72cad6db08eeda58c7c5784014ecristy          image->depth,(double) depth);
728b51dff5c0d16a4c1b69ff683e786cb3b4c467694cristy      (void) FormatLocaleFile(file,"  Channel depth:\n");
7293ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      switch (colorspace)
7303ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      {
7313ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        case RGBColorspace:
7323ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        default:
7333ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        {
734cffbc33ac5bcff5d383527f13e8fac35675c9e18cristy          (void) FormatLocaleFile(file,"    Red: %.20g-bit\n",(double)
73595a072b9674d607b5318a3283fd3952e82107828cristy            channel_statistics[RedPixelChannel].depth);
736cffbc33ac5bcff5d383527f13e8fac35675c9e18cristy          (void) FormatLocaleFile(file,"    Green: %.20g-bit\n",(double)
73795a072b9674d607b5318a3283fd3952e82107828cristy            channel_statistics[GreenPixelChannel].depth);
738cffbc33ac5bcff5d383527f13e8fac35675c9e18cristy          (void) FormatLocaleFile(file,"    Blue: %.20g-bit\n",(double)
73995a072b9674d607b5318a3283fd3952e82107828cristy            channel_statistics[BluePixelChannel].depth);
7403ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          break;
7413ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        }
7423ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        case CMYKColorspace:
7433ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        {
744cffbc33ac5bcff5d383527f13e8fac35675c9e18cristy          (void) FormatLocaleFile(file,"    Cyan: %.20g-bit\n",(double)
74595a072b9674d607b5318a3283fd3952e82107828cristy            channel_statistics[CyanPixelChannel].depth);
746cffbc33ac5bcff5d383527f13e8fac35675c9e18cristy          (void) FormatLocaleFile(file,"    Magenta: %.20g-bit\n",(double)
74795a072b9674d607b5318a3283fd3952e82107828cristy            channel_statistics[MagentaPixelChannel].depth);
748cffbc33ac5bcff5d383527f13e8fac35675c9e18cristy          (void) FormatLocaleFile(file,"    Yellow: %.20g-bit\n",(double)
74995a072b9674d607b5318a3283fd3952e82107828cristy            channel_statistics[YellowPixelChannel].depth);
750cffbc33ac5bcff5d383527f13e8fac35675c9e18cristy          (void) FormatLocaleFile(file,"    Black: %.20g-bit\n",(double)
75195a072b9674d607b5318a3283fd3952e82107828cristy            channel_statistics[BlackPixelChannel].depth);
7523ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          break;
7533ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        }
7543ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        case GRAYColorspace:
7553ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        {
756cffbc33ac5bcff5d383527f13e8fac35675c9e18cristy          (void) FormatLocaleFile(file,"    Gray: %.20g-bit\n",(double)
75795a072b9674d607b5318a3283fd3952e82107828cristy            channel_statistics[GrayPixelChannel].depth);
7583ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          break;
7593ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        }
7603ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      }
76117f11b056210f082a6d0e54ac5d68e6d72fa76b2cristy      if (image->alpha_trait != UndefinedPixelTrait)
762b7282479021a027e14fe6943255df536d913f0f8dirk        (void) FormatLocaleFile(file,"    Alpha: %.20g-bit\n",(double)
76395a072b9674d607b5318a3283fd3952e82107828cristy          channel_statistics[AlphaPixelChannel].depth);
764cb9af4ac6134e7e15e7d344489e9e0f634e1b4c1cristy      scale=1.0;
7653ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      if (image->depth <= MAGICKCORE_QUANTUM_DEPTH)
766cb9af4ac6134e7e15e7d344489e9e0f634e1b4c1cristy        scale=(double) QuantumRange/((size_t) QuantumRange >> ((size_t)
7673ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          MAGICKCORE_QUANTUM_DEPTH-image->depth));
76815a88784c852291054bf90cb761449504b5327d8cristy    }
76915a88784c852291054bf90cb761449504b5327d8cristy  if (channel_statistics != (ChannelStatistics *) NULL)
77015a88784c852291054bf90cb761449504b5327d8cristy    {
771b51dff5c0d16a4c1b69ff683e786cb3b4c467694cristy      (void) FormatLocaleFile(file,"  Channel statistics:\n");
772d67357f52b3821fc12fffcb2bde9e1f6ff3b23b6cristy      (void) FormatLocaleFile(file,"    Pixels: %.20g\n",(double)
773d67357f52b3821fc12fffcb2bde9e1f6ff3b23b6cristy        image->columns*image->rows);
7743ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      switch (colorspace)
7753ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      {
7763ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        case RGBColorspace:
7773ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        default:
7783ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        {
77995a072b9674d607b5318a3283fd3952e82107828cristy          (void) PrintChannelStatistics(file,RedPixelChannel,"Red",1.0/
78095a072b9674d607b5318a3283fd3952e82107828cristy            scale,channel_statistics);
78195a072b9674d607b5318a3283fd3952e82107828cristy          (void) PrintChannelStatistics(file,GreenPixelChannel,"Green",1.0/
78295a072b9674d607b5318a3283fd3952e82107828cristy            scale,channel_statistics);
78395a072b9674d607b5318a3283fd3952e82107828cristy          (void) PrintChannelStatistics(file,BluePixelChannel,"Blue",1.0/
78495a072b9674d607b5318a3283fd3952e82107828cristy            scale,channel_statistics);
7853ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          break;
7863ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        }
7873ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        case CMYKColorspace:
7883ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        {
78995a072b9674d607b5318a3283fd3952e82107828cristy          (void) PrintChannelStatistics(file,CyanPixelChannel,"Cyan",1.0/
79095a072b9674d607b5318a3283fd3952e82107828cristy            scale,channel_statistics);
79195a072b9674d607b5318a3283fd3952e82107828cristy          (void) PrintChannelStatistics(file,MagentaPixelChannel,"Magenta",1.0/
79295a072b9674d607b5318a3283fd3952e82107828cristy            scale,channel_statistics);
79395a072b9674d607b5318a3283fd3952e82107828cristy          (void) PrintChannelStatistics(file,YellowPixelChannel,"Yellow",1.0/
79495a072b9674d607b5318a3283fd3952e82107828cristy            scale,channel_statistics);
79595a072b9674d607b5318a3283fd3952e82107828cristy          (void) PrintChannelStatistics(file,BlackPixelChannel,"Black",1.0/
79695a072b9674d607b5318a3283fd3952e82107828cristy            scale,channel_statistics);
7973ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          break;
7983ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        }
7993ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        case GRAYColorspace:
8003ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        {
80195a072b9674d607b5318a3283fd3952e82107828cristy          (void) PrintChannelStatistics(file,GrayPixelChannel,"Gray",1.0/
80295a072b9674d607b5318a3283fd3952e82107828cristy            scale,channel_statistics);
8033ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          break;
8043ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        }
8053ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      }
80617f11b056210f082a6d0e54ac5d68e6d72fa76b2cristy      if (image->alpha_trait != UndefinedPixelTrait)
80795a072b9674d607b5318a3283fd3952e82107828cristy        (void) PrintChannelStatistics(file,AlphaPixelChannel,"Alpha",1.0/
80895a072b9674d607b5318a3283fd3952e82107828cristy          scale,channel_statistics);
8093ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      if (colorspace != GRAYColorspace)
8103ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        {
811b51dff5c0d16a4c1b69ff683e786cb3b4c467694cristy          (void) FormatLocaleFile(file,"  Image statistics:\n");
8123fac9ec43830fab0a3f88bff607734eb99ea6b1ccristy          (void) PrintChannelStatistics(file,(PixelChannel) MaxPixelChannels,
8133fac9ec43830fab0a3f88bff607734eb99ea6b1ccristy            "Overall",1.0/scale,channel_statistics);
8143ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        }
8153ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      channel_statistics=(ChannelStatistics *) RelinquishMagickMemory(
8163ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        channel_statistics);
817bd82207b3816471fba4de916fca7336f38b70493cristy    }
818bd4a3c228c0e785517b8ab630b2cc6095373f710cristy  if (channel_moments != (ChannelMoments *) NULL)
819bd4a3c228c0e785517b8ab630b2cc6095373f710cristy    {
820cb9af4ac6134e7e15e7d344489e9e0f634e1b4c1cristy      scale=(double) ((1UL << image->depth)-1);
82189fc6f7966b0025bc0109678da2694345527c279cristy      (void) FormatLocaleFile(file,"  Channel moments:\n");
822bd4a3c228c0e785517b8ab630b2cc6095373f710cristy      switch (colorspace)
823bd4a3c228c0e785517b8ab630b2cc6095373f710cristy      {
824bd4a3c228c0e785517b8ab630b2cc6095373f710cristy        case RGBColorspace:
825bd4a3c228c0e785517b8ab630b2cc6095373f710cristy        default:
826bd4a3c228c0e785517b8ab630b2cc6095373f710cristy        {
827cb9af4ac6134e7e15e7d344489e9e0f634e1b4c1cristy          (void) PrintChannelMoments(file,RedPixelChannel,"Red",scale,
828bd4a3c228c0e785517b8ab630b2cc6095373f710cristy            channel_moments);
829cb9af4ac6134e7e15e7d344489e9e0f634e1b4c1cristy          (void) PrintChannelMoments(file,GreenPixelChannel,"Green",scale,
830bd4a3c228c0e785517b8ab630b2cc6095373f710cristy            channel_moments);
831cb9af4ac6134e7e15e7d344489e9e0f634e1b4c1cristy          (void) PrintChannelMoments(file,BluePixelChannel,"Blue",scale,
832bd4a3c228c0e785517b8ab630b2cc6095373f710cristy            channel_moments);
833bd4a3c228c0e785517b8ab630b2cc6095373f710cristy          break;
834bd4a3c228c0e785517b8ab630b2cc6095373f710cristy        }
835bd4a3c228c0e785517b8ab630b2cc6095373f710cristy        case CMYKColorspace:
836bd4a3c228c0e785517b8ab630b2cc6095373f710cristy        {
837cb9af4ac6134e7e15e7d344489e9e0f634e1b4c1cristy          (void) PrintChannelMoments(file,CyanPixelChannel,"Cyan",scale,
838bd4a3c228c0e785517b8ab630b2cc6095373f710cristy            channel_moments);
839cb9af4ac6134e7e15e7d344489e9e0f634e1b4c1cristy          (void) PrintChannelMoments(file,MagentaPixelChannel,"Magenta",scale,
840bd4a3c228c0e785517b8ab630b2cc6095373f710cristy            channel_moments);
841cb9af4ac6134e7e15e7d344489e9e0f634e1b4c1cristy          (void) PrintChannelMoments(file,YellowPixelChannel,"Yellow",scale,
842bd4a3c228c0e785517b8ab630b2cc6095373f710cristy            channel_moments);
843cb9af4ac6134e7e15e7d344489e9e0f634e1b4c1cristy          (void) PrintChannelMoments(file,BlackPixelChannel,"Black",scale,
844bd4a3c228c0e785517b8ab630b2cc6095373f710cristy            channel_moments);
845bd4a3c228c0e785517b8ab630b2cc6095373f710cristy          break;
846bd4a3c228c0e785517b8ab630b2cc6095373f710cristy        }
847bd4a3c228c0e785517b8ab630b2cc6095373f710cristy        case GRAYColorspace:
848bd4a3c228c0e785517b8ab630b2cc6095373f710cristy        {
849cb9af4ac6134e7e15e7d344489e9e0f634e1b4c1cristy          (void) PrintChannelMoments(file,GrayPixelChannel,"Gray",scale,
850bd4a3c228c0e785517b8ab630b2cc6095373f710cristy            channel_moments);
851bd4a3c228c0e785517b8ab630b2cc6095373f710cristy          break;
852bd4a3c228c0e785517b8ab630b2cc6095373f710cristy        }
853bd4a3c228c0e785517b8ab630b2cc6095373f710cristy      }
85417f11b056210f082a6d0e54ac5d68e6d72fa76b2cristy      if (image->alpha_trait != UndefinedPixelTrait)
855cb9af4ac6134e7e15e7d344489e9e0f634e1b4c1cristy        (void) PrintChannelMoments(file,AlphaPixelChannel,"Alpha",scale,
856bd4a3c228c0e785517b8ab630b2cc6095373f710cristy          channel_moments);
857878fe619e0b9bf6e01f6c4b0e9c71e105ec7c81ecristy      if (colorspace != GRAYColorspace)
858878fe619e0b9bf6e01f6c4b0e9c71e105ec7c81ecristy        {
859878fe619e0b9bf6e01f6c4b0e9c71e105ec7c81ecristy          (void) FormatLocaleFile(file,"  Image moments:\n");
860878fe619e0b9bf6e01f6c4b0e9c71e105ec7c81ecristy          (void) PrintChannelMoments(file,(PixelChannel) MaxPixelChannels,
861cb9af4ac6134e7e15e7d344489e9e0f634e1b4c1cristy            "Overall",scale,channel_moments);
862878fe619e0b9bf6e01f6c4b0e9c71e105ec7c81ecristy        }
863bd4a3c228c0e785517b8ab630b2cc6095373f710cristy      channel_moments=(ChannelMoments *) RelinquishMagickMemory(
864bd4a3c228c0e785517b8ab630b2cc6095373f710cristy        channel_moments);
865bd4a3c228c0e785517b8ab630b2cc6095373f710cristy    }
866b3538ec3d53d5853f18e99b510cd855ac870c281cristy  if (channel_phash != (ChannelPerceptualHash *) NULL)
867b3538ec3d53d5853f18e99b510cd855ac870c281cristy    {
868b3538ec3d53d5853f18e99b510cd855ac870c281cristy      (void) FormatLocaleFile(file,"  Channel perceptual hash:\n");
869fb4b9cbc3c15dbeea523fc2373e1e16e598c3e74dirk      (void) PrintChannelPerceptualHash(file,RedPixelChannel,"Red, Hue",
870b3538ec3d53d5853f18e99b510cd855ac870c281cristy        channel_phash);
871fb4b9cbc3c15dbeea523fc2373e1e16e598c3e74dirk      (void) PrintChannelPerceptualHash(file,GreenPixelChannel,"Green, Chroma",
872b3538ec3d53d5853f18e99b510cd855ac870c281cristy        channel_phash);
873fb4b9cbc3c15dbeea523fc2373e1e16e598c3e74dirk      (void) PrintChannelPerceptualHash(file,BluePixelChannel,"Blue, Luma",
874b3538ec3d53d5853f18e99b510cd855ac870c281cristy        channel_phash);
87517f11b056210f082a6d0e54ac5d68e6d72fa76b2cristy      if (image->alpha_trait != UndefinedPixelTrait)
876fb4b9cbc3c15dbeea523fc2373e1e16e598c3e74dirk        (void) PrintChannelPerceptualHash(file,AlphaPixelChannel,"Alpha, Alpha",
877b3538ec3d53d5853f18e99b510cd855ac870c281cristy          channel_phash);
878b3538ec3d53d5853f18e99b510cd855ac870c281cristy      channel_phash=(ChannelPerceptualHash *) RelinquishMagickMemory(
879b3538ec3d53d5853f18e99b510cd855ac870c281cristy        channel_phash);
880b3538ec3d53d5853f18e99b510cd855ac870c281cristy    }
881bd82207b3816471fba4de916fca7336f38b70493cristy  if (channel_features != (ChannelFeatures *) NULL)
882bd82207b3816471fba4de916fca7336f38b70493cristy    {
8831e604812fad85bb96f757a2393015ae3d061c39acristy      (void) FormatLocaleFile(file,"  Channel features (horizontal, vertical, "
8841e604812fad85bb96f757a2393015ae3d061c39acristy        "left and right diagonals, average):\n");
885bd82207b3816471fba4de916fca7336f38b70493cristy      switch (colorspace)
886bd82207b3816471fba4de916fca7336f38b70493cristy      {
887bd82207b3816471fba4de916fca7336f38b70493cristy        case RGBColorspace:
888bd82207b3816471fba4de916fca7336f38b70493cristy        default:
889549a37e6cd4593dcb997230cd3584c5afead5552cristy        {
89095a072b9674d607b5318a3283fd3952e82107828cristy          (void) PrintChannelFeatures(file,RedPixelChannel,"Red",
89195a072b9674d607b5318a3283fd3952e82107828cristy            channel_features);
89295a072b9674d607b5318a3283fd3952e82107828cristy          (void) PrintChannelFeatures(file,GreenPixelChannel,"Green",
89395a072b9674d607b5318a3283fd3952e82107828cristy            channel_features);
89495a072b9674d607b5318a3283fd3952e82107828cristy          (void) PrintChannelFeatures(file,BluePixelChannel,"Blue",
895bd82207b3816471fba4de916fca7336f38b70493cristy            channel_features);
896bd82207b3816471fba4de916fca7336f38b70493cristy          break;
897549a37e6cd4593dcb997230cd3584c5afead5552cristy        }
898bd82207b3816471fba4de916fca7336f38b70493cristy        case CMYKColorspace:
899bd82207b3816471fba4de916fca7336f38b70493cristy        {
90095a072b9674d607b5318a3283fd3952e82107828cristy          (void) PrintChannelFeatures(file,CyanPixelChannel,"Cyan",
90195a072b9674d607b5318a3283fd3952e82107828cristy            channel_features);
90295a072b9674d607b5318a3283fd3952e82107828cristy          (void) PrintChannelFeatures(file,MagentaPixelChannel,"Magenta",
903bd82207b3816471fba4de916fca7336f38b70493cristy            channel_features);
90495a072b9674d607b5318a3283fd3952e82107828cristy          (void) PrintChannelFeatures(file,YellowPixelChannel,"Yellow",
905bd82207b3816471fba4de916fca7336f38b70493cristy            channel_features);
90695a072b9674d607b5318a3283fd3952e82107828cristy          (void) PrintChannelFeatures(file,BlackPixelChannel,"Black",
907bd82207b3816471fba4de916fca7336f38b70493cristy            channel_features);
908bd82207b3816471fba4de916fca7336f38b70493cristy          break;
909bd82207b3816471fba4de916fca7336f38b70493cristy        }
910bd82207b3816471fba4de916fca7336f38b70493cristy        case GRAYColorspace:
911bd82207b3816471fba4de916fca7336f38b70493cristy        {
91295a072b9674d607b5318a3283fd3952e82107828cristy          (void) PrintChannelFeatures(file,GrayPixelChannel,"Gray",
91395a072b9674d607b5318a3283fd3952e82107828cristy            channel_features);
914bd82207b3816471fba4de916fca7336f38b70493cristy          break;
915bd82207b3816471fba4de916fca7336f38b70493cristy        }
916bd82207b3816471fba4de916fca7336f38b70493cristy      }
91717f11b056210f082a6d0e54ac5d68e6d72fa76b2cristy      if (image->alpha_trait != UndefinedPixelTrait)
91895a072b9674d607b5318a3283fd3952e82107828cristy        (void) PrintChannelFeatures(file,AlphaPixelChannel,"Alpha",
91995a072b9674d607b5318a3283fd3952e82107828cristy          channel_features);
920bd82207b3816471fba4de916fca7336f38b70493cristy      channel_features=(ChannelFeatures *) RelinquishMagickMemory(
921bd82207b3816471fba4de916fca7336f38b70493cristy        channel_features);
922bd82207b3816471fba4de916fca7336f38b70493cristy    }
923bd82207b3816471fba4de916fca7336f38b70493cristy  if (ping == MagickFalse)
924bd82207b3816471fba4de916fca7336f38b70493cristy    {
9253ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      if (image->colorspace == CMYKColorspace)
926d0393a47265c7e6a3607da71445a4617c63decc3cristy        (void) FormatLocaleFile(file,"  Total ink density: %*g%%\n",
927d0393a47265c7e6a3607da71445a4617c63decc3cristy          GetMagickPrecision(),100.0*GetImageTotalInkDensity(image,exception)/
928d0393a47265c7e6a3607da71445a4617c63decc3cristy          (double) QuantumRange);
9293ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      x=0;
93017f11b056210f082a6d0e54ac5d68e6d72fa76b2cristy      if (image->alpha_trait != UndefinedPixelTrait)
9313ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        {
9324c08aed51c5899665ade97263692328eea4af106cristy          register const Quantum
9333ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            *p;
9343ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
9354c08aed51c5899665ade97263692328eea4af106cristy          p=(const Quantum *) NULL;
936bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy          for (y=0; y < (ssize_t) image->rows; y++)
9373ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          {
9383ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            p=GetVirtualPixels(image,0,y,image->columns,1,exception);
9394c08aed51c5899665ade97263692328eea4af106cristy            if (p == (const Quantum *) NULL)
9403ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              break;
941bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy            for (x=0; x < (ssize_t) image->columns; x++)
9423ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            {
9434c08aed51c5899665ade97263692328eea4af106cristy              if (GetPixelAlpha(image,p) == (Quantum) TransparentAlpha)
9443ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                break;
945ed2315769b26818ed9d0c1291dc0457f0d8da0a4cristy              p+=GetPixelChannels(image);
9463ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            }
947bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy            if (x < (ssize_t) image->columns)
9483ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              break;
9493ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          }
950bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy          if ((x < (ssize_t) image->columns) || (y < (ssize_t) image->rows))
9513ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            {
9523ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              char
953151b66dffc9e3c2e8c4f8cdaca37ff987ca0f497cristy                tuple[MagickPathExtent];
9543ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
9554c08aed51c5899665ade97263692328eea4af106cristy              PixelInfo
9563ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                pixel;
9573ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
9584c08aed51c5899665ade97263692328eea4af106cristy              GetPixelInfo(image,&pixel);
959803640d20a6a664315eddfff6f8531d0c5e0871dcristy              GetPixelInfoPixel(image,p,&pixel);
960269c9413034627692b2a7d0a352f9dee4e8eada8cristy              (void) QueryColorname(image,&pixel,SVGCompliance,tuple,
961a403727ea73ef5840a476a3c4614445807f42827cristy                exception);
962b51dff5c0d16a4c1b69ff683e786cb3b4c467694cristy              (void) FormatLocaleFile(file,"  Alpha: %s ",tuple);
9633ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              GetColorTuple(&pixel,MagickTrue,tuple);
964b51dff5c0d16a4c1b69ff683e786cb3b4c467694cristy              (void) FormatLocaleFile(file,"  %s\n",tuple);
9653ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            }
9663ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        }
967a403727ea73ef5840a476a3c4614445807f42827cristy      if (IsHistogramImage(image,exception) != MagickFalse)
9683ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        {
9694c9675696ac29c2b0c76941870fa5178f28fe073cristy          (void) FormatLocaleFile(file,"  Colors: %.20g\n",(double)
970a403727ea73ef5840a476a3c4614445807f42827cristy            GetNumberColors(image,(FILE *) NULL,exception));
971b51dff5c0d16a4c1b69ff683e786cb3b4c467694cristy          (void) FormatLocaleFile(file,"  Histogram:\n");
972a403727ea73ef5840a476a3c4614445807f42827cristy          (void) GetNumberColors(image,file,exception);
9733ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        }
974e64d6379b1d6cda3a2a75777ca192156b105f65ccristy      else
975e64d6379b1d6cda3a2a75777ca192156b105f65ccristy        {
9766f2013165d72f7d8ef5f66bb9453126d88113809anthony          artifact=GetImageArtifact(image,"identify:unique-colors");
977038f9eed0f96d4fdf925391a8dcb2e71ddce0d28dirk          if (IsStringTrue(artifact) != MagickFalse)
9786f2013165d72f7d8ef5f66bb9453126d88113809anthony            (void) FormatLocaleFile(file,"  Colors: %.20g\n",(double)
9796f2013165d72f7d8ef5f66bb9453126d88113809anthony              GetNumberColors(image,(FILE *) NULL,exception));
9806f2013165d72f7d8ef5f66bb9453126d88113809anthony        }
9813ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    }
9823ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  if (image->storage_class == PseudoClass)
9833ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    {
984404558c09d01517ca1f775c41f6b740576584637cristy      (void) FormatLocaleFile(file,"  Colormap entries: %.20g\n",(double)
985404558c09d01517ca1f775c41f6b740576584637cristy        image->colors);
986e64d6379b1d6cda3a2a75777ca192156b105f65ccristy      (void) FormatLocaleFile(file,"  Colormap:\n");
9873ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      if (image->colors <= 1024)
9883ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        {
9893ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          char
990151b66dffc9e3c2e8c4f8cdaca37ff987ca0f497cristy            color[MagickPathExtent],
991151b66dffc9e3c2e8c4f8cdaca37ff987ca0f497cristy            hex[MagickPathExtent],
992151b66dffc9e3c2e8c4f8cdaca37ff987ca0f497cristy            tuple[MagickPathExtent];
9933ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
9944c08aed51c5899665ade97263692328eea4af106cristy          PixelInfo
9953ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            pixel;
9963ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
997101ab708b0574518ac5715da4d3915400e9df79acristy          register PixelInfo
99805d2ff7ebf21f659f5b11e45afb294e152f4330cdirk            *magick_restrict p;
9993ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
10004c08aed51c5899665ade97263692328eea4af106cristy          GetPixelInfo(image,&pixel);
10013ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          p=image->colormap;
1002bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy          for (i=0; i < (ssize_t) image->colors; i++)
10033ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          {
10049d8c8ce096b3b8b2b1df1aec061f17eabba22b1dcristy            pixel=(*p);
1005151b66dffc9e3c2e8c4f8cdaca37ff987ca0f497cristy            (void) CopyMagickString(tuple,"(",MagickPathExtent);
1006ed2315769b26818ed9d0c1291dc0457f0d8da0a4cristy            ConcatenateColorComponent(&pixel,RedPixelChannel,X11Compliance,
1007fa806a74dd82d44b9f4e860add18bd65b200d23acristy              tuple);
1008151b66dffc9e3c2e8c4f8cdaca37ff987ca0f497cristy            (void) ConcatenateMagickString(tuple,",",MagickPathExtent);
1009ed2315769b26818ed9d0c1291dc0457f0d8da0a4cristy            ConcatenateColorComponent(&pixel,GreenPixelChannel,X11Compliance,
1010fa806a74dd82d44b9f4e860add18bd65b200d23acristy              tuple);
1011151b66dffc9e3c2e8c4f8cdaca37ff987ca0f497cristy            (void) ConcatenateMagickString(tuple,",",MagickPathExtent);
1012ed2315769b26818ed9d0c1291dc0457f0d8da0a4cristy            ConcatenateColorComponent(&pixel,BluePixelChannel,X11Compliance,
1013fa806a74dd82d44b9f4e860add18bd65b200d23acristy              tuple);
10143ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            if (pixel.colorspace == CMYKColorspace)
10153ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              {
1016151b66dffc9e3c2e8c4f8cdaca37ff987ca0f497cristy                (void) ConcatenateMagickString(tuple,",",MagickPathExtent);
1017ed2315769b26818ed9d0c1291dc0457f0d8da0a4cristy                ConcatenateColorComponent(&pixel,BlackPixelChannel,
1018fa806a74dd82d44b9f4e860add18bd65b200d23acristy                  X11Compliance,tuple);
10193ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              }
102017f11b056210f082a6d0e54ac5d68e6d72fa76b2cristy            if (pixel.alpha_trait != UndefinedPixelTrait)
10213ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              {
1022151b66dffc9e3c2e8c4f8cdaca37ff987ca0f497cristy                (void) ConcatenateMagickString(tuple,",",MagickPathExtent);
1023ed2315769b26818ed9d0c1291dc0457f0d8da0a4cristy                ConcatenateColorComponent(&pixel,AlphaPixelChannel,
1024fa806a74dd82d44b9f4e860add18bd65b200d23acristy                  X11Compliance,tuple);
10253ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              }
1026151b66dffc9e3c2e8c4f8cdaca37ff987ca0f497cristy            (void) ConcatenateMagickString(tuple,")",MagickPathExtent);
1027269c9413034627692b2a7d0a352f9dee4e8eada8cristy            (void) QueryColorname(image,&pixel,SVGCompliance,color,
1028a403727ea73ef5840a476a3c4614445807f42827cristy              exception);
10293ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            GetColorTuple(&pixel,MagickTrue,hex);
10301e604812fad85bb96f757a2393015ae3d061c39acristy            (void) FormatLocaleFile(file,"  %8ld: %s %s %s\n",(long) i,tuple,
10311e604812fad85bb96f757a2393015ae3d061c39acristy              hex,color);
10323ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            p++;
10333ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          }
10343ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        }
10353ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    }
10363ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  if (image->error.mean_error_per_pixel != 0.0)
1037b51dff5c0d16a4c1b69ff683e786cb3b4c467694cristy    (void) FormatLocaleFile(file,"  Mean error per pixel: %g\n",
10383ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      image->error.mean_error_per_pixel);
10393ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  if (image->error.normalized_mean_error != 0.0)
1040b51dff5c0d16a4c1b69ff683e786cb3b4c467694cristy    (void) FormatLocaleFile(file,"  Normalized mean error: %g\n",
10413ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      image->error.normalized_mean_error);
10423ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  if (image->error.normalized_maximum_error != 0.0)
1043b51dff5c0d16a4c1b69ff683e786cb3b4c467694cristy    (void) FormatLocaleFile(file,"  Normalized maximum error: %g\n",
10443ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      image->error.normalized_maximum_error);
10451e604812fad85bb96f757a2393015ae3d061c39acristy  (void) FormatLocaleFile(file,"  Rendering intent: %s\n",
10461e604812fad85bb96f757a2393015ae3d061c39acristy    CommandOptionToMnemonic(MagickIntentOptions,(ssize_t)
10471e604812fad85bb96f757a2393015ae3d061c39acristy    image->rendering_intent));
10483ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  if (image->gamma != 0.0)
1049b51dff5c0d16a4c1b69ff683e786cb3b4c467694cristy    (void) FormatLocaleFile(file,"  Gamma: %g\n",image->gamma);
10503ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  if ((image->chromaticity.red_primary.x != 0.0) ||
10513ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      (image->chromaticity.green_primary.x != 0.0) ||
10523ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      (image->chromaticity.blue_primary.x != 0.0) ||
10533ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      (image->chromaticity.white_point.x != 0.0))
10543ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    {
10553ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      /*
10563ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        Display image chromaticity.
10573ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      */
1058b51dff5c0d16a4c1b69ff683e786cb3b4c467694cristy      (void) FormatLocaleFile(file,"  Chromaticity:\n");
1059b51dff5c0d16a4c1b69ff683e786cb3b4c467694cristy      (void) FormatLocaleFile(file,"    red primary: (%g,%g)\n",
10603ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        image->chromaticity.red_primary.x,image->chromaticity.red_primary.y);
1061b51dff5c0d16a4c1b69ff683e786cb3b4c467694cristy      (void) FormatLocaleFile(file,"    green primary: (%g,%g)\n",
10623ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        image->chromaticity.green_primary.x,
10633ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        image->chromaticity.green_primary.y);
1064b51dff5c0d16a4c1b69ff683e786cb3b4c467694cristy      (void) FormatLocaleFile(file,"    blue primary: (%g,%g)\n",
10653ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        image->chromaticity.blue_primary.x,image->chromaticity.blue_primary.y);
1066b51dff5c0d16a4c1b69ff683e786cb3b4c467694cristy      (void) FormatLocaleFile(file,"    white point: (%g,%g)\n",
10673ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        image->chromaticity.white_point.x,image->chromaticity.white_point.y);
10683ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    }
10693ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  if ((image->extract_info.width*image->extract_info.height) != 0)
10701e604812fad85bb96f757a2393015ae3d061c39acristy    (void) FormatLocaleFile(file,"  Tile geometry: %.20gx%.20g%+.20g%+.20g\n",
10711e604812fad85bb96f757a2393015ae3d061c39acristy      (double) image->extract_info.width,(double) image->extract_info.height,
10721e604812fad85bb96f757a2393015ae3d061c39acristy      (double) image->extract_info.x,(double) image->extract_info.y);
1073b797b2c96f796f4920c9ee807dc5f47e6f160418dirk  (void) QueryColorname(image,&image->alpha_color,SVGCompliance,color,
1074b797b2c96f796f4920c9ee807dc5f47e6f160418dirk    exception);
1075b797b2c96f796f4920c9ee807dc5f47e6f160418dirk  (void) FormatLocaleFile(file,"  Alpha color: %s\n",color);
10763ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  (void) QueryColorname(image,&image->background_color,SVGCompliance,color,
1077a403727ea73ef5840a476a3c4614445807f42827cristy    exception);
1078b51dff5c0d16a4c1b69ff683e786cb3b4c467694cristy  (void) FormatLocaleFile(file,"  Background color: %s\n",color);
10793ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  (void) QueryColorname(image,&image->border_color,SVGCompliance,color,
1080a403727ea73ef5840a476a3c4614445807f42827cristy    exception);
1081b51dff5c0d16a4c1b69ff683e786cb3b4c467694cristy  (void) FormatLocaleFile(file,"  Border color: %s\n",color);
10823ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  (void) QueryColorname(image,&image->transparent_color,SVGCompliance,color,
1083a403727ea73ef5840a476a3c4614445807f42827cristy    exception);
1084b51dff5c0d16a4c1b69ff683e786cb3b4c467694cristy  (void) FormatLocaleFile(file,"  Transparent color: %s\n",color);
1085a4d10f7ffc6c69b2c5ab7ecadaf64c5b624204c2cristy  (void) FormatLocaleFile(file,"  Interlace: %s\n",CommandOptionToMnemonic(
1086a4d10f7ffc6c69b2c5ab7ecadaf64c5b624204c2cristy    MagickInterlaceOptions,(ssize_t) image->interlace));
1087a4d10f7ffc6c69b2c5ab7ecadaf64c5b624204c2cristy  (void) FormatLocaleFile(file,"  Intensity: %s\n",CommandOptionToMnemonic(
1088a4d10f7ffc6c69b2c5ab7ecadaf64c5b624204c2cristy    MagickPixelIntensityOptions,(ssize_t) image->intensity));
1089b51dff5c0d16a4c1b69ff683e786cb3b4c467694cristy  (void) FormatLocaleFile(file,"  Compose: %s\n",CommandOptionToMnemonic(
1090bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy    MagickComposeOptions,(ssize_t) image->compose));
10913ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  if ((image->page.width != 0) || (image->page.height != 0) ||
10923ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      (image->page.x != 0) || (image->page.y != 0))
10931e604812fad85bb96f757a2393015ae3d061c39acristy    (void) FormatLocaleFile(file,"  Page geometry: %.20gx%.20g%+.20g%+.20g\n",
10941e604812fad85bb96f757a2393015ae3d061c39acristy      (double) image->page.width,(double) image->page.height,(double)
1095e8c25f9b4c9fb72cad6db08eeda58c7c5784014ecristy      image->page.x,(double) image->page.y);
10963ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  if ((image->page.x != 0) || (image->page.y != 0))
1097b51dff5c0d16a4c1b69ff683e786cb3b4c467694cristy    (void) FormatLocaleFile(file,"  Origin geometry: %+.20g%+.20g\n",(double)
1098e8c25f9b4c9fb72cad6db08eeda58c7c5784014ecristy      image->page.x,(double) image->page.y);
1099b51dff5c0d16a4c1b69ff683e786cb3b4c467694cristy  (void) FormatLocaleFile(file,"  Dispose: %s\n",CommandOptionToMnemonic(
1100bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy    MagickDisposeOptions,(ssize_t) image->dispose));
11013ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  if (image->delay != 0)
1102b51dff5c0d16a4c1b69ff683e786cb3b4c467694cristy    (void) FormatLocaleFile(file,"  Delay: %.20gx%.20g\n",(double) image->delay,
1103e8c25f9b4c9fb72cad6db08eeda58c7c5784014ecristy      (double) image->ticks_per_second);
11043ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  if (image->iterations != 1)
11051e604812fad85bb96f757a2393015ae3d061c39acristy    (void) FormatLocaleFile(file,"  Iterations: %.20g\n",(double)
11061e604812fad85bb96f757a2393015ae3d061c39acristy      image->iterations);
1107b844bd5119042ba96a17b45c4c403aed6b98212bglennrp  if (image->duration != 0)
1108b844bd5119042ba96a17b45c4c403aed6b98212bglennrp    (void) FormatLocaleFile(file,"  Duration: %.20g\n",(double)
1109b844bd5119042ba96a17b45c4c403aed6b98212bglennrp      image->duration);
11103ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  if ((image->next != (Image *) NULL) || (image->previous != (Image *) NULL))
11111e604812fad85bb96f757a2393015ae3d061c39acristy    (void) FormatLocaleFile(file,"  Scene: %.20g of %.20g\n",(double)
11121e604812fad85bb96f757a2393015ae3d061c39acristy      image->scene,(double) GetImageListLength(image));
11133ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  else
11143ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    if (image->scene != 0)
1115b51dff5c0d16a4c1b69ff683e786cb3b4c467694cristy      (void) FormatLocaleFile(file,"  Scene: %.20g\n",(double) image->scene);
1116b51dff5c0d16a4c1b69ff683e786cb3b4c467694cristy  (void) FormatLocaleFile(file,"  Compression: %s\n",CommandOptionToMnemonic(
1117bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy    MagickCompressOptions,(ssize_t) image->compression));
111807f628aa54b6f5c258610093bfe15f18713b91d3cristy  if (image->quality != UndefinedCompressionQuality)
111992beec634ee9ca3bb6e1f341baf09c3785893546cristy    (void) FormatLocaleFile(file,"  Quality: %.20g\n",(double) image->quality);
1120e7820580363f4dad29eb23e3062248a703df122ccristy  (void) FormatLocaleFile(file,"  Orientation: %s\n",CommandOptionToMnemonic(
1121e7820580363f4dad29eb23e3062248a703df122ccristy    MagickOrientationOptions,(ssize_t) image->orientation));
11223ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  if (image->montage != (char *) NULL)
1123b51dff5c0d16a4c1b69ff683e786cb3b4c467694cristy    (void) FormatLocaleFile(file,"  Montage: %s\n",image->montage);
11243ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  if (image->directory != (char *) NULL)
11253ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    {
11263ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      Image
11273ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        *tile;
11283ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
11293ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      ImageInfo
11303ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        *image_info;
11313ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
11323ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      register char
11333ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        *p,
11343ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        *q;
11353ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
11363ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      WarningHandler
11373ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        handler;
11383ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
11393ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      /*
11403ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        Display visual image directory.
11413ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      */
11423ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      image_info=AcquireImageInfo();
11433ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      (void) CloneString(&image_info->size,"64x64");
1144b51dff5c0d16a4c1b69ff683e786cb3b4c467694cristy      (void) FormatLocaleFile(file,"  Directory:\n");
11453ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      for (p=image->directory; *p != '\0'; p++)
11463ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      {
11473ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        q=p;
11483ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        while ((*q != '\n') && (*q != '\0'))
11493ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          q++;
11503ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        (void) CopyMagickString(image_info->filename,p,(size_t) (q-p+1));
11513ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        p=q;
1152b51dff5c0d16a4c1b69ff683e786cb3b4c467694cristy        (void) FormatLocaleFile(file,"    %s",image_info->filename);
11533ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        handler=SetWarningHandler((WarningHandler) NULL);
1154a403727ea73ef5840a476a3c4614445807f42827cristy        tile=ReadImage(image_info,exception);
11553ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        (void) SetWarningHandler(handler);
11563ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        if (tile == (Image *) NULL)
11573ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          {
1158b51dff5c0d16a4c1b69ff683e786cb3b4c467694cristy            (void) FormatLocaleFile(file,"\n");
11593ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            continue;
11603ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          }
11611e604812fad85bb96f757a2393015ae3d061c39acristy        (void) FormatLocaleFile(file," %.20gx%.20g %s\n",(double)
11621e604812fad85bb96f757a2393015ae3d061c39acristy          tile->magick_columns,(double) tile->magick_rows,tile->magick);
1163018f07f7333b25743d0afff892450cebdb905c1acristy        (void) SignatureImage(tile,exception);
11643ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        ResetImagePropertyIterator(tile);
11653ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        property=GetNextImageProperty(tile);
11663ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        while (property != (const char *) NULL)
11673ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        {
1168b51dff5c0d16a4c1b69ff683e786cb3b4c467694cristy          (void) FormatLocaleFile(file,"  %s:\n",property);
1169d15e65928aec551b7388c2863de3e3e628e2e0ddcristy          value=GetImageProperty(tile,property,exception);
11703ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          if (value != (const char *) NULL)
1171b51dff5c0d16a4c1b69ff683e786cb3b4c467694cristy            (void) FormatLocaleFile(file,"%s\n",value);
11723ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          property=GetNextImageProperty(tile);
11733ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        }
11743ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        tile=DestroyImage(tile);
11753ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      }
11763ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      image_info=DestroyImageInfo(image_info);
11773ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    }
1178d15e65928aec551b7388c2863de3e3e628e2e0ddcristy  (void) GetImageProperty(image,"exif:*",exception);
117955166324d63eec5bf5a353b0045be4755fb159eacristy  (void) GetImageProperty(image,"icc:*",exception);
118055166324d63eec5bf5a353b0045be4755fb159eacristy  (void) GetImageProperty(image,"iptc:*",exception);
118155166324d63eec5bf5a353b0045be4755fb159eacristy  (void) GetImageProperty(image,"xmp:*",exception);
11823ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  ResetImagePropertyIterator(image);
11833ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  property=GetNextImageProperty(image);
11843ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  if (property != (const char *) NULL)
11853ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    {
11863ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      /*
11873ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        Display image properties.
11883ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      */
1189b51dff5c0d16a4c1b69ff683e786cb3b4c467694cristy      (void) FormatLocaleFile(file,"  Properties:\n");
11903ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      while (property != (const char *) NULL)
11913ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      {
1192b51dff5c0d16a4c1b69ff683e786cb3b4c467694cristy        (void) FormatLocaleFile(file,"    %s: ",property);
1193d15e65928aec551b7388c2863de3e3e628e2e0ddcristy        value=GetImageProperty(image,property,exception);
11943ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        if (value != (const char *) NULL)
1195b51dff5c0d16a4c1b69ff683e786cb3b4c467694cristy          (void) FormatLocaleFile(file,"%s\n",value);
11963ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        property=GetNextImageProperty(image);
11973ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      }
11983ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    }
1199151b66dffc9e3c2e8c4f8cdaca37ff987ca0f497cristy  (void) FormatLocaleString(key,MagickPathExtent,"8BIM:1999,2998:#1");
1200d15e65928aec551b7388c2863de3e3e628e2e0ddcristy  value=GetImageProperty(image,key,exception);
12013ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  if (value != (const char *) NULL)
12023ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    {
12033ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      /*
12043ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        Display clipping path.
12053ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      */
1206b51dff5c0d16a4c1b69ff683e786cb3b4c467694cristy      (void) FormatLocaleFile(file,"  Clipping path: ");
12073ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      if (strlen(value) > 80)
12083ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        (void) fputc('\n',file);
1209b51dff5c0d16a4c1b69ff683e786cb3b4c467694cristy      (void) FormatLocaleFile(file,"%s\n",value);
12103ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    }
12113ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  ResetImageProfileIterator(image);
12123ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  name=GetNextImageProfile(image);
12133ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  if (name != (char *) NULL)
12143ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    {
12153ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      const StringInfo
12163ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        *profile;
12173ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
12183ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      /*
12193ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        Identify image profiles.
12203ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      */
1221b51dff5c0d16a4c1b69ff683e786cb3b4c467694cristy      (void) FormatLocaleFile(file,"  Profiles:\n");
12223ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      while (name != (char *) NULL)
12233ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      {
12243ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        profile=GetImageProfile(image,name);
12253ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        if (profile == (StringInfo *) NULL)
12263ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          continue;
12271e604812fad85bb96f757a2393015ae3d061c39acristy        (void) FormatLocaleFile(file,"    Profile-%s: %.20g bytes\n",name,
12281e604812fad85bb96f757a2393015ae3d061c39acristy          (double) GetStringInfoLength(profile));
12293ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        if (LocaleCompare(name,"iptc") == 0)
12303ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          {
12313ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            char
12323ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              *attribute,
12333ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              **attribute_list;
12343ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
12353ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            const char
12363ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              *tag;
12373ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
1238cee9711bbc334b5677d5ec4ea1cc70340d35ee35cristy            long
12393ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              dataset,
12403ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              record,
12413ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              sentinel;
12423ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
1243bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy            register ssize_t
12443ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              j;
12453ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
12463ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            size_t
12473ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              length,
12483ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              profile_length;
12493ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
12503ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            profile_length=GetStringInfoLength(profile);
1251bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy            for (i=0; i < (ssize_t) profile_length; i+=(ssize_t) length)
12523ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            {
12533ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              length=1;
12543ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              sentinel=GetStringInfoDatum(profile)[i++];
12553ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              if (sentinel != 0x1c)
12563ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                continue;
12573ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              dataset=GetStringInfoDatum(profile)[i++];
12583ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              record=GetStringInfoDatum(profile)[i++];
12593ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              switch (record)
12603ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              {
12613ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                case 5: tag="Image Name"; break;
12623ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                case 7: tag="Edit Status"; break;
12633ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                case 10: tag="Priority"; break;
12643ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                case 15: tag="Category"; break;
12653ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                case 20: tag="Supplemental Category"; break;
12663ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                case 22: tag="Fixture Identifier"; break;
12673ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                case 25: tag="Keyword"; break;
12683ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                case 30: tag="Release Date"; break;
12693ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                case 35: tag="Release Time"; break;
12703ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                case 40: tag="Special Instructions"; break;
12713ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                case 45: tag="Reference Service"; break;
12723ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                case 47: tag="Reference Date"; break;
12733ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                case 50: tag="Reference Number"; break;
12743ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                case 55: tag="Created Date"; break;
12753ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                case 60: tag="Created Time"; break;
12763ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                case 65: tag="Originating Program"; break;
12773ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                case 70: tag="Program Version"; break;
12783ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                case 75: tag="Object Cycle"; break;
12793ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                case 80: tag="Byline"; break;
12803ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                case 85: tag="Byline Title"; break;
12813ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                case 90: tag="City"; break;
1282a0b0ad36ac96fb94cf9ee81591fcf788c6f11d3fcristy                case 92: tag="Sub-Location"; break;
12833ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                case 95: tag="Province State"; break;
12843ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                case 100: tag="Country Code"; break;
12853ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                case 101: tag="Country"; break;
12863ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                case 103: tag="Original Transmission Reference"; break;
12873ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                case 105: tag="Headline"; break;
12883ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                case 110: tag="Credit"; break;
12893ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                case 115: tag="Src"; break;
12903ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                case 116: tag="Copyright String"; break;
12913ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                case 120: tag="Caption"; break;
12923ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                case 121: tag="Local Caption"; break;
12933ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                case 122: tag="Caption Writer"; break;
12943ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                case 200: tag="Custom Field 1"; break;
12953ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                case 201: tag="Custom Field 2"; break;
12963ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                case 202: tag="Custom Field 3"; break;
12973ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                case 203: tag="Custom Field 4"; break;
12983ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                case 204: tag="Custom Field 5"; break;
12993ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                case 205: tag="Custom Field 6"; break;
13003ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                case 206: tag="Custom Field 7"; break;
13013ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                case 207: tag="Custom Field 8"; break;
13023ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                case 208: tag="Custom Field 9"; break;
13033ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                case 209: tag="Custom Field 10"; break;
13043ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                case 210: tag="Custom Field 11"; break;
13053ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                case 211: tag="Custom Field 12"; break;
13063ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                case 212: tag="Custom Field 13"; break;
13073ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                case 213: tag="Custom Field 14"; break;
13083ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                case 214: tag="Custom Field 15"; break;
13093ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                case 215: tag="Custom Field 16"; break;
13103ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                case 216: tag="Custom Field 17"; break;
13113ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                case 217: tag="Custom Field 18"; break;
13123ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                case 218: tag="Custom Field 19"; break;
13133ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                case 219: tag="Custom Field 20"; break;
13143ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                default: tag="unknown"; break;
13153ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              }
13161e604812fad85bb96f757a2393015ae3d061c39acristy              (void) FormatLocaleFile(file,"      %s[%.20g,%.20g]: ",tag,
13171e604812fad85bb96f757a2393015ae3d061c39acristy                (double) dataset,(double) record);
13183ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              length=(size_t) (GetStringInfoDatum(profile)[i++] << 8);
13193ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              length|=GetStringInfoDatum(profile)[i++];
13203ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              attribute=(char *) NULL;
1321151b66dffc9e3c2e8c4f8cdaca37ff987ca0f497cristy              if (~length >= (MagickPathExtent-1))
1322151b66dffc9e3c2e8c4f8cdaca37ff987ca0f497cristy                attribute=(char *) AcquireQuantumMemory(length+MagickPathExtent,
1323a403727ea73ef5840a476a3c4614445807f42827cristy                  sizeof(*attribute));
13243ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              if (attribute != (char *) NULL)
13253ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                {
13263ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                  (void) CopyMagickString(attribute,(char *)
13273ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                    GetStringInfoDatum(profile)+i,length+1);
13283ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                  attribute_list=StringToList(attribute);
13293ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                  if (attribute_list != (char **) NULL)
13303ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                    {
13313ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                      for (j=0; attribute_list[j] != (char *) NULL; j++)
13323ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                      {
13333ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                        (void) fputs(attribute_list[j],file);
13343ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                        (void) fputs("\n",file);
13353ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                        attribute_list[j]=(char *) RelinquishMagickMemory(
13363ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                          attribute_list[j]);
13373ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                      }
13383ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                      attribute_list=(char **) RelinquishMagickMemory(
13393ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                        attribute_list);
13403ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                    }
13413ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                  attribute=DestroyString(attribute);
13423ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                }
13433ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            }
13443ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          }
13453ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        if (image->debug != MagickFalse)
13463ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          PrintStringInfo(file,name,profile);
13473ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        name=GetNextImageProfile(image);
13483ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      }
13493ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    }
13503ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  ResetImageArtifactIterator(image);
13513ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  artifact=GetNextImageArtifact(image);
13523ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  if (artifact != (const char *) NULL)
13533ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    {
13543ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      /*
13553ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        Display image artifacts.
13563ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      */
1357b51dff5c0d16a4c1b69ff683e786cb3b4c467694cristy      (void) FormatLocaleFile(file,"  Artifacts:\n");
13583ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      while (artifact != (const char *) NULL)
13593ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      {
1360b51dff5c0d16a4c1b69ff683e786cb3b4c467694cristy        (void) FormatLocaleFile(file,"    %s: ",artifact);
13613ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        value=GetImageArtifact(image,artifact);
13623ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        if (value != (const char *) NULL)
1363b51dff5c0d16a4c1b69ff683e786cb3b4c467694cristy          (void) FormatLocaleFile(file,"%s\n",value);
13643ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        artifact=GetNextImageArtifact(image);
13653ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      }
13663ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    }
13673ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  ResetImageRegistryIterator();
13683ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  registry=GetNextImageRegistry();
13693ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  if (registry != (const char *) NULL)
13703ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    {
13713ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      /*
13723ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        Display image registry.
13733ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      */
1374b51dff5c0d16a4c1b69ff683e786cb3b4c467694cristy      (void) FormatLocaleFile(file,"  Registry:\n");
13753ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      while (registry != (const char *) NULL)
13763ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      {
1377b51dff5c0d16a4c1b69ff683e786cb3b4c467694cristy        (void) FormatLocaleFile(file,"    %s: ",registry);
13783ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        value=(const char *) GetImageRegistry(StringRegistryType,registry,
1379a403727ea73ef5840a476a3c4614445807f42827cristy          exception);
13803ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        if (value != (const char *) NULL)
1381b51dff5c0d16a4c1b69ff683e786cb3b4c467694cristy          (void) FormatLocaleFile(file,"%s\n",value);
13823ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        registry=GetNextImageRegistry();
13833ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      }
13843ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    }
1385b51dff5c0d16a4c1b69ff683e786cb3b4c467694cristy  (void) FormatLocaleFile(file,"  Tainted: %s\n",CommandOptionToMnemonic(
1386bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy    MagickBooleanOptions,(ssize_t) image->taint));
1387151b66dffc9e3c2e8c4f8cdaca37ff987ca0f497cristy  (void) FormatMagickSize(GetBlobSize(image),MagickFalse,"B",MagickPathExtent,
1388d4618c0bfed02b00a0b112dfc619da885355e189cristy    format);
13899c47c73fa67a9301cf2205c741aa12af3c6fe6c3cristy  (void) FormatLocaleFile(file,"  Filesize: %s\n",format);
1390b9080c9660565c4ab556254f276bfeca3d4edf02cristy  (void) FormatMagickSize((MagickSizeType) image->columns*image->rows,
1391151b66dffc9e3c2e8c4f8cdaca37ff987ca0f497cristy    MagickFalse,"B",MagickPathExtent,format);
13920c1b97692d6e3bb63af47617a3c3b072897ee5d2cristy  if (strlen(format) > 1)
13930c1b97692d6e3bb63af47617a3c3b072897ee5d2cristy    format[strlen(format)-1]='\0';
1394b51dff5c0d16a4c1b69ff683e786cb3b4c467694cristy  (void) FormatLocaleFile(file,"  Number pixels: %s\n",format);
13953d23169aa81971c55ca0036a29f773182142e6bbcristy  (void) FormatMagickSize((MagickSizeType) ((double) image->columns*image->rows/
1396151b66dffc9e3c2e8c4f8cdaca37ff987ca0f497cristy    elapsed_time+0.5),MagickFalse,"B",MagickPathExtent,format);
1397b51dff5c0d16a4c1b69ff683e786cb3b4c467694cristy  (void) FormatLocaleFile(file,"  Pixels per second: %s\n",format);
1398b51dff5c0d16a4c1b69ff683e786cb3b4c467694cristy  (void) FormatLocaleFile(file,"  User time: %0.3fu\n",user_time);
13991e604812fad85bb96f757a2393015ae3d061c39acristy  (void) FormatLocaleFile(file,"  Elapsed time: %lu:%02lu.%03lu\n",
1400a403727ea73ef5840a476a3c4614445807f42827cristy    (unsigned long) (elapsed_time/60.0),(unsigned long) ceil(fmod(elapsed_time,
1401a403727ea73ef5840a476a3c4614445807f42827cristy    60.0)),(unsigned long) (1000.0*(elapsed_time-floor(elapsed_time))));
1402b51dff5c0d16a4c1b69ff683e786cb3b4c467694cristy  (void) FormatLocaleFile(file,"  Version: %s\n",GetMagickVersion((size_t *)
14033d23169aa81971c55ca0036a29f773182142e6bbcristy    NULL));
14043ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  (void) fflush(file);
14053ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  return(ferror(file) != 0 ? MagickFalse : MagickTrue);
14063ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
1407