blob: e0bce1059e267f4aab6d94554ba303df1fd75504 [file] [log] [blame]
cristy3ed852e2009-09-05 21:47:34 +00001/*
2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3% %
4% %
5% %
6% IIIII DDDD EEEEE N N TTTTT IIIII FFFFF Y Y %
7% I D D E NN N T I F Y Y %
8% I D D EEE N N N T I FFF Y %
9% I D D E N NN T I F Y %
10% IIIII DDDD EEEEE N N T IIIII F Y %
11% %
12% %
13% Identify an Image Format and Characteristics. %
14% %
15% Software Design %
16% John Cristy %
17% September 1994 %
18% %
19% %
20% Copyright 1999-2008 ImageMagick Studio LLC, a non-profit organization %
21% dedicated to making software imaging solutions freely available. %
22% %
23% You may not use this file except in compliance with the License. You may %
24% obtain a copy of the License at %
25% %
26% http://www.imagemagick.org/script/license.php %
27% %
28% Unless required by applicable law or agreed to in writing, software %
29% distributed under the License is distributed on an "AS IS" BASIS, %
30% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. %
31% See the License for the specific language governing permissions and %
32% limitations under the License. %
33% %
34%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
35%
36% Identify describes the format and characteristics of one or more image
37% files. It will also report if an image is incomplete or corrupt.
38%
39%
40*/
41
42/*
43 Include declarations.
44*/
45#include "magick/studio.h"
46#include "magick/annotate.h"
47#include "magick/artifact.h"
cristy78e9c762009-10-14 19:36:18 +000048#include "magick/attribute.h"
cristy3ed852e2009-09-05 21:47:34 +000049#include "magick/blob.h"
50#include "magick/cache.h"
51#include "magick/client.h"
52#include "magick/coder.h"
53#include "magick/color.h"
54#include "magick/configure.h"
55#include "magick/constitute.h"
56#include "magick/decorate.h"
57#include "magick/delegate.h"
58#include "magick/draw.h"
59#include "magick/effect.h"
60#include "magick/exception.h"
61#include "magick/exception-private.h"
cristy549a37e2010-01-26 15:24:15 +000062#include "magick/feature.h"
cristy3ed852e2009-09-05 21:47:34 +000063#include "magick/gem.h"
64#include "magick/geometry.h"
cristyf2e11662009-10-14 01:24:43 +000065#include "magick/histogram.h"
cristy3ed852e2009-09-05 21:47:34 +000066#include "magick/identify.h"
67#include "magick/image.h"
68#include "magick/image-private.h"
69#include "magick/list.h"
70#include "magick/locale_.h"
71#include "magick/log.h"
72#include "magick/magic.h"
73#include "magick/magick.h"
74#include "magick/memory_.h"
75#include "magick/module.h"
76#include "magick/monitor.h"
77#include "magick/montage.h"
78#include "magick/option.h"
79#include "magick/pixel-private.h"
80#include "magick/prepress.h"
81#include "magick/profile.h"
82#include "magick/property.h"
83#include "magick/quantize.h"
84#include "magick/quantum.h"
85#include "magick/random_.h"
86#include "magick/registry.h"
87#include "magick/resize.h"
88#include "magick/resource_.h"
89#include "magick/signature.h"
90#include "magick/statistic.h"
91#include "magick/string_.h"
cristycd483f12010-01-26 15:30:08 +000092#include "magick/string-private.h"
cristy3ed852e2009-09-05 21:47:34 +000093#include "magick/timer.h"
94#include "magick/utility.h"
95#include "magick/version.h"
96#if defined(MAGICKCORE_LCMS_DELEGATE)
97#if defined(MAGICKCORE_HAVE_LCMS_LCMS_H)
98#include <lcms/lcms.h>
99#else
100#include "lcms.h"
101#endif
102#endif
103
104/*
105%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
106% %
107% %
108% %
109% I d e n t i f y I m a g e %
110% %
111% %
112% %
113%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
114%
115% IdentifyImage() identifies an image by printing its attributes to the file.
116% Attributes include the image width, height, size, and others.
117%
118% The format of the IdentifyImage method is:
119%
120% MagickBooleanType IdentifyImage(Image *image,FILE *file,
121% const MagickBooleanType verbose)
122%
123% A description of each parameter follows:
124%
125% o image: the image.
126%
127% o file: the file, typically stdout.
128%
129% o verbose: A value other than zero prints more detailed information
130% about the image.
131%
132*/
133
cristybd822072010-01-27 00:30:00 +0000134static int PrintChannelFeatures(FILE *file,const ChannelType channel,
cristye1897792010-01-29 02:05:50 +0000135 const char *name,const ChannelFeatures *channel_features)
cristy3ed852e2009-09-05 21:47:34 +0000136{
cristye1897792010-01-29 02:05:50 +0000137#define PrintFeature(feature) \
138 GetMagickPrecision(),(feature)[0], \
139 GetMagickPrecision(),(feature)[1], \
140 GetMagickPrecision(),(feature)[2], \
cristye0acabf2010-01-30 00:52:38 +0000141 GetMagickPrecision(),(feature)[3], \
142 GetMagickPrecision(),((feature)[0]+(feature)[1]+(feature)[2]+(feature)[3])/4.0 \
cristye1897792010-01-29 02:05:50 +0000143
cristybd822072010-01-27 00:30:00 +0000144#define FeaturesFormat " %s:\n" \
cristycdf8e1b2010-01-28 01:52:33 +0000145 " Angular Second Moment:\n" \
cristye0acabf2010-01-30 00:52:38 +0000146 " %.*g, %.*g, %.*g, %.*g, %.*g\n" \
cristycdf8e1b2010-01-28 01:52:33 +0000147 " Contrast:\n" \
cristye0acabf2010-01-30 00:52:38 +0000148 " %.*g, %.*g, %.*g, %.*g, %.*g\n" \
cristycdf8e1b2010-01-28 01:52:33 +0000149 " Correlation:\n" \
cristye0acabf2010-01-30 00:52:38 +0000150 " %.*g, %.*g, %.*g, %.*g, %.*g\n" \
cristye1897792010-01-29 02:05:50 +0000151 " Sum of Squares: Variance:\n" \
cristye0acabf2010-01-30 00:52:38 +0000152 " %.*g, %.*g, %.*g, %.*g, %.*g\n" \
cristycf5e6492010-01-28 02:45:28 +0000153 " Inverse Difference Moment:\n" \
cristye0acabf2010-01-30 00:52:38 +0000154 " %.*g, %.*g, %.*g, %.*g, %.*g\n" \
cristye1897792010-01-29 02:05:50 +0000155 " Sum Average:\n" \
cristye0acabf2010-01-30 00:52:38 +0000156 " %.*g, %.*g, %.*g, %.*g, %.*g\n" \
cristye1897792010-01-29 02:05:50 +0000157 " Sum Variance:\n" \
cristye0acabf2010-01-30 00:52:38 +0000158 " %.*g, %.*g, %.*g, %.*g, %.*g\n" \
cristye1897792010-01-29 02:05:50 +0000159 " Sum Entropy:\n" \
cristye0acabf2010-01-30 00:52:38 +0000160 " %.*g, %.*g, %.*g, %.*g, %.*g\n" \
cristye1897792010-01-29 02:05:50 +0000161 " Entropy:\n" \
cristye0acabf2010-01-30 00:52:38 +0000162 " %.*g, %.*g, %.*g, %.*g, %.*g\n" \
cristye1897792010-01-29 02:05:50 +0000163 " Difference Variance:\n" \
cristye0acabf2010-01-30 00:52:38 +0000164 " %.*g, %.*g, %.*g, %.*g, %.*g\n" \
cristye0e19dc2010-01-29 02:13:08 +0000165 " Difference Entropy:\n" \
cristye0acabf2010-01-30 00:52:38 +0000166 " %.*g, %.*g, %.*g, %.*g, %.*g\n" \
cristye0e19dc2010-01-29 02:13:08 +0000167 " Information Measure of Correlation 1:\n" \
cristye0acabf2010-01-30 00:52:38 +0000168 " %.*g, %.*g, %.*g, %.*g, %.*g\n" \
cristye0e19dc2010-01-29 02:13:08 +0000169 " Information Measure of Correlation 2:\n" \
cristye0acabf2010-01-30 00:52:38 +0000170 " %.*g, %.*g, %.*g, %.*g, %.*g\n" \
cristye0e19dc2010-01-29 02:13:08 +0000171 " Maximum Correlation Coefficient:\n" \
cristye0acabf2010-01-30 00:52:38 +0000172 " %.*g, %.*g, %.*g, %.*g, %.*g\n"
cristybd822072010-01-27 00:30:00 +0000173
174 int
175 status;
176
177 status=fprintf(file,FeaturesFormat,name,
cristye1897792010-01-29 02:05:50 +0000178 PrintFeature(channel_features[channel].angular_second_moment),
179 PrintFeature(channel_features[channel].contrast),
180 PrintFeature(channel_features[channel].correlation),
181 PrintFeature(channel_features[channel].variance_sum_of_squares),
182 PrintFeature(channel_features[channel].inverse_difference_moment),
183 PrintFeature(channel_features[channel].sum_average),
184 PrintFeature(channel_features[channel].sum_variance),
185 PrintFeature(channel_features[channel].sum_entropy),
186 PrintFeature(channel_features[channel].entropy),
cristye0e19dc2010-01-29 02:13:08 +0000187 PrintFeature(channel_features[channel].difference_variance),
188 PrintFeature(channel_features[channel].difference_entropy),
189 PrintFeature(channel_features[channel].measure_of_correlation_1),
190 PrintFeature(channel_features[channel].measure_of_correlation_2),
191 PrintFeature(channel_features[channel].maximum_correlation_coefficient));
cristybd822072010-01-27 00:30:00 +0000192 return(status);
193}
194
195static int PrintChannelStatistics(FILE *file,const ChannelType channel,
196 const char *name,const double scale,
197 const ChannelStatistics *channel_statistics)
198{
199#define StatisticsFormat " %s:\n min: " QuantumFormat \
cristye7f51092010-01-17 00:39:37 +0000200 " (%g)\n max: " QuantumFormat " (%g)\n" \
201 " mean: %g (%g)\n standard deviation: %g (%g)\n" \
202 " kurtosis: %g\n skewness: %g\n"
cristy3ed852e2009-09-05 21:47:34 +0000203
cristybd822072010-01-27 00:30:00 +0000204 double
205 maxima,
206 mean,
207 minima;
208
209 int
210 status;
211
212 minima=channel_statistics[channel].minima;
213 maxima=channel_statistics[channel].maxima;
214 mean=channel_statistics[channel].mean;
215 if (channel == AlphaChannel)
216 {
217 minima=QuantumRange-minima;
218 maxima=QuantumRange-maxima;
219 mean=QuantumRange-mean;
220 }
221 status=fprintf(file,StatisticsFormat,name,(Quantum) (scale*minima),minima/
222 (double) QuantumRange,(Quantum) (maxima/scale),maxima/(double) QuantumRange,
223 scale*mean,mean/(double) QuantumRange,
224 scale*channel_statistics[channel].standard_deviation,
225 channel_statistics[channel].standard_deviation/(double)
226 QuantumRange,channel_statistics[channel].kurtosis,
227 channel_statistics[channel].skewness);
228 return(status);
229}
230
231MagickExport MagickBooleanType IdentifyImage(Image *image,FILE *file,
232 const MagickBooleanType verbose)
233{
cristy3ed852e2009-09-05 21:47:34 +0000234 char
235 color[MaxTextExtent],
236 format[MaxTextExtent],
237 key[MaxTextExtent];
238
cristybd822072010-01-27 00:30:00 +0000239 ChannelFeatures
240 *channel_features;
241
242 ChannelStatistics
243 *channel_statistics;
244
cristy3ed852e2009-09-05 21:47:34 +0000245 ColorspaceType
246 colorspace;
247
248 const char
249 *artifact,
250 *name,
251 *property,
252 *registry,
253 *value;
254
255 const MagickInfo
256 *magick_info;
257
258 const PixelPacket
259 *pixels;
260
261 double
262 elapsed_time,
263 user_time;
264
265 ExceptionInfo
266 *exception;
267
268 ImageType
269 type;
270
271 long
272 y;
273
274 MagickBooleanType
275 ping;
276
277 register long
278 i,
279 x;
280
281 unsigned long
cristybd822072010-01-27 00:30:00 +0000282 distance,
cristy3ed852e2009-09-05 21:47:34 +0000283 scale;
284
285 assert(image != (Image *) NULL);
286 assert(image->signature == MagickSignature);
287 if (image->debug != MagickFalse)
288 (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
289 if (file == (FILE *) NULL)
290 file=stdout;
291 *format='\0';
292 elapsed_time=GetElapsedTime(&image->timer);
293 user_time=GetUserTime(&image->timer);
294 GetTimerInfo(&image->timer);
295 if (verbose == MagickFalse)
296 {
297 /*
298 Display summary info about the image.
299 */
300 if (*image->magick_filename != '\0')
301 if (LocaleCompare(image->magick_filename,image->filename) != 0)
302 (void) fprintf(file,"%s=>",image->magick_filename);
303 if ((GetPreviousImageInList(image) == (Image *) NULL) &&
cristy81b8ce52010-02-05 01:53:17 +0000304 (GetNextImageInList(image) == (Image *) NULL) &&
305 (image->scene == 0))
cristy3ed852e2009-09-05 21:47:34 +0000306 (void) fprintf(file,"%s ",image->filename);
307 else
308 (void) fprintf(file,"%s[%lu] ",image->filename,image->scene);
309 (void) fprintf(file,"%s ",image->magick);
310 if ((image->magick_columns != 0) || (image->magick_rows != 0))
311 if ((image->magick_columns != image->columns) ||
312 (image->magick_rows != image->rows))
313 (void) fprintf(file,"%lux%lu=>",image->magick_columns,
314 image->magick_rows);
315 (void) fprintf(file,"%lux%lu ",image->columns,image->rows);
316 if ((image->page.width != 0) || (image->page.height != 0) ||
317 (image->page.x != 0) || (image->page.y != 0))
318 (void) fprintf(file,"%lux%lu%+ld%+ld ",image->page.width,
319 image->page.height,image->page.x,image->page.y);
320 (void) fprintf(file,"%lu-bit ",image->depth);
321 if (image->type != UndefinedType)
322 (void) fprintf(file,"%s ",MagickOptionToMnemonic(MagickTypeOptions,
323 (long) image->type));
324 if (image->storage_class == DirectClass)
325 {
326 (void) fprintf(file,"DirectClass ");
327 if (image->total_colors != 0)
328 {
cristyb9080c92009-12-01 20:13:26 +0000329 (void) FormatMagickSize(image->total_colors,MagickFalse,format);
cristy3ed852e2009-09-05 21:47:34 +0000330 (void) fprintf(file,"%s ",format);
331 }
332 }
333 else
334 if (image->total_colors <= image->colors)
335 (void) fprintf(file,"PseudoClass %luc ",image->colors);
336 else
337 (void) fprintf(file,"PseudoClass %lu=>%luc ",image->total_colors,
338 image->colors);
339 if (image->error.mean_error_per_pixel != 0.0)
340 (void) fprintf(file,"%ld/%f/%fdb ",(long)
341 (image->error.mean_error_per_pixel+0.5),
342 image->error.normalized_mean_error,
343 image->error.normalized_maximum_error);
344 if (GetBlobSize(image) != 0)
345 {
cristyb9080c92009-12-01 20:13:26 +0000346 (void) FormatMagickSize(GetBlobSize(image),MagickFalse,format);
cristy3ed852e2009-09-05 21:47:34 +0000347 (void) fprintf(file,"%s ",format);
348 }
cristy3d231692009-09-29 01:05:22 +0000349 (void) fprintf(file,"%0.3fu %ld:%02ld.%03ld",user_time,(long)
350 (elapsed_time/60.0),(long) floor(fmod(elapsed_time,60.0)),
351 (long) (1000.0*(elapsed_time-floor(elapsed_time))));
cristy3ed852e2009-09-05 21:47:34 +0000352 (void) fprintf(file,"\n");
353 (void) fflush(file);
354 return(ferror(file) != 0 ? MagickFalse : MagickTrue);
355 }
356 /*
357 Display verbose info about the image.
358 */
359 exception=AcquireExceptionInfo();
360 pixels=GetVirtualPixels(image,0,0,1,1,exception);
361 exception=DestroyExceptionInfo(exception);
362 ping=pixels == (const PixelPacket *) NULL ? MagickTrue : MagickFalse;
363 type=GetImageType(image,&image->exception);
364 (void) SignatureImage(image);
365 (void) fprintf(file,"Image: %s\n",image->filename);
366 if (*image->magick_filename != '\0')
367 if (LocaleCompare(image->magick_filename,image->filename) != 0)
368 {
369 char
370 filename[MaxTextExtent];
371
372 GetPathComponent(image->magick_filename,TailPath,filename);
373 (void) fprintf(file," Base filename: %s\n",filename);
374 }
375 magick_info=GetMagickInfo(image->magick,&image->exception);
376 if ((magick_info == (const MagickInfo *) NULL) ||
377 (*GetMagickDescription(magick_info) == '\0'))
378 (void) fprintf(file," Format: %s\n",image->magick);
379 else
380 (void) fprintf(file," Format: %s (%s)\n",image->magick,
381 GetMagickDescription(magick_info));
382 (void) fprintf(file," Class: %s\n",MagickOptionToMnemonic(MagickClassOptions,
383 (long) image->storage_class));
384 (void) fprintf(file," Geometry: %lux%lu%+ld%+ld\n",image->columns,
385 image->rows,image->tile_offset.x,image->tile_offset.y);
386 if ((image->magick_columns != 0) || (image->magick_rows != 0))
387 if ((image->magick_columns != image->columns) ||
388 (image->magick_rows != image->rows))
389 (void) fprintf(file," Base geometry: %lux%lu\n",image->magick_columns,
390 image->magick_rows);
391 if ((image->x_resolution != 0.0) && (image->y_resolution != 0.0))
392 {
cristye7f51092010-01-17 00:39:37 +0000393 (void) fprintf(file," Resolution: %gx%g\n",image->x_resolution,
cristy3ed852e2009-09-05 21:47:34 +0000394 image->y_resolution);
cristye7f51092010-01-17 00:39:37 +0000395 (void) fprintf(file," Print size: %gx%g\n",(double) image->columns/
cristy3ed852e2009-09-05 21:47:34 +0000396 image->x_resolution,(double) image->rows/image->y_resolution);
397 }
398 (void) fprintf(file," Units: %s\n",MagickOptionToMnemonic(
399 MagickResolutionOptions,(long) image->units));
400 (void) fprintf(file," Type: %s\n",MagickOptionToMnemonic(MagickTypeOptions,
401 (long) type));
402 if (image->type != UndefinedType)
403 (void) fprintf(file," Base type: %s\n",MagickOptionToMnemonic(
404 MagickTypeOptions,(long) image->type));
405 (void) fprintf(file," Endianess: %s\n",MagickOptionToMnemonic(
406 MagickEndianOptions,(long) image->endian));
407 /*
408 Detail channel depth and extrema.
409 */
410 (void) fprintf(file," Colorspace: %s\n",MagickOptionToMnemonic(
411 MagickColorspaceOptions,(long) image->colorspace));
cristybd822072010-01-27 00:30:00 +0000412 channel_statistics=(ChannelStatistics *) NULL;
cristy15a88782010-01-31 23:24:49 +0000413 channel_features=(ChannelFeatures *) NULL;
414 colorspace=image->colorspace;
cristy3ed852e2009-09-05 21:47:34 +0000415 if (ping == MagickFalse)
416 {
cristy3ed852e2009-09-05 21:47:34 +0000417 unsigned long
418 depth;
419
cristy15a88782010-01-31 23:24:49 +0000420 channel_statistics=GetImageChannelStatistics(image,&image->exception);
421 artifact=GetImageArtifact(image,"identify:features");
422 if (artifact != (const char *) NULL)
423 {
424 distance=StringToUnsignedLong(artifact);
425 channel_features=GetImageChannelFeatures(image,distance,
426 &image->exception);
427 }
cristy3ed852e2009-09-05 21:47:34 +0000428 depth=GetImageDepth(image,&image->exception);
429 if (image->depth == depth)
430 (void) fprintf(file," Depth: %lu-bit\n",image->depth);
431 else
432 (void) fprintf(file," Depth: %lu/%lu-bit\n",image->depth,depth);
cristy3ed852e2009-09-05 21:47:34 +0000433 (void) fprintf(file," Channel depth:\n");
cristy3ed852e2009-09-05 21:47:34 +0000434 if (IsGrayImage(image,&image->exception) != MagickFalse)
435 colorspace=GRAYColorspace;
436 switch (colorspace)
437 {
438 case RGBColorspace:
439 default:
440 {
441 (void) fprintf(file," red: %lu-bit\n",
442 channel_statistics[RedChannel].depth);
443 (void) fprintf(file," green: %lu-bit\n",
444 channel_statistics[GreenChannel].depth);
445 (void) fprintf(file," blue: %lu-bit\n",
446 channel_statistics[BlueChannel].depth);
447 if (image->matte != MagickFalse)
448 (void) fprintf(file," alpha: %lu-bit\n",
449 channel_statistics[OpacityChannel].depth);
450 break;
451 }
452 case CMYKColorspace:
453 {
454 (void) fprintf(file," cyan: %lu-bit\n",
455 channel_statistics[CyanChannel].depth);
456 (void) fprintf(file," magenta: %lu-bit\n",
457 channel_statistics[MagentaChannel].depth);
458 (void) fprintf(file," yellow: %lu-bit\n",
459 channel_statistics[YellowChannel].depth);
460 (void) fprintf(file," black: %lu-bit\n",
461 channel_statistics[BlackChannel].depth);
462 if (image->matte != MagickFalse)
463 (void) fprintf(file," alpha: %lu-bit\n",
464 channel_statistics[OpacityChannel].depth);
465 break;
466 }
467 case GRAYColorspace:
468 {
469 (void) fprintf(file," gray: %lu-bit\n",
470 channel_statistics[GrayChannel].depth);
471 if (image->matte != MagickFalse)
472 (void) fprintf(file," alpha: %lu-bit\n",
473 channel_statistics[OpacityChannel].depth);
474 break;
475 }
476 }
477 scale=1;
478 if (image->depth <= MAGICKCORE_QUANTUM_DEPTH)
479 scale=QuantumRange/((unsigned long) QuantumRange >> ((unsigned long)
480 MAGICKCORE_QUANTUM_DEPTH-image->depth));
cristy15a88782010-01-31 23:24:49 +0000481 }
482 if (channel_statistics != (ChannelStatistics *) NULL)
483 {
cristy3ed852e2009-09-05 21:47:34 +0000484 (void) fprintf(file," Channel statistics:\n");
485 switch (colorspace)
486 {
487 case RGBColorspace:
488 default:
489 {
cristybd822072010-01-27 00:30:00 +0000490 (void) PrintChannelStatistics(file,RedChannel,"Red",1.0/scale,
491 channel_statistics);
492 (void) PrintChannelStatistics(file,GreenChannel,"Green",1.0/scale,
493 channel_statistics);
494 (void) PrintChannelStatistics(file,BlueChannel,"Blue",1.0/scale,
495 channel_statistics);
cristy3ed852e2009-09-05 21:47:34 +0000496 break;
497 }
498 case CMYKColorspace:
499 {
cristybd822072010-01-27 00:30:00 +0000500 (void) PrintChannelStatistics(file,CyanChannel,"Cyan",1.0/scale,
501 channel_statistics);
502 (void) PrintChannelStatistics(file,MagentaChannel,"Magenta",1.0/scale,
503 channel_statistics);
504 (void) PrintChannelStatistics(file,YellowChannel,"Yellow",1.0/scale,
505 channel_statistics);
506 (void) PrintChannelStatistics(file,BlackChannel,"Black",1.0/scale,
507 channel_statistics);
cristy3ed852e2009-09-05 21:47:34 +0000508 break;
509 }
510 case GRAYColorspace:
511 {
cristybd822072010-01-27 00:30:00 +0000512 (void) PrintChannelStatistics(file,GrayChannel,"Gray",1.0/scale,
513 channel_statistics);
cristy3ed852e2009-09-05 21:47:34 +0000514 break;
515 }
516 }
517 if (image->matte != MagickFalse)
cristybd822072010-01-27 00:30:00 +0000518 (void) PrintChannelStatistics(file,AlphaChannel,"Alpha",1.0/scale,
519 channel_statistics);
cristy3ed852e2009-09-05 21:47:34 +0000520 if (colorspace != GRAYColorspace)
521 {
522 (void) fprintf(file," Image statistics:\n");
cristybd822072010-01-27 00:30:00 +0000523 (void) PrintChannelStatistics(file,AllChannels,"Overall",1.0/scale,
524 channel_statistics);
cristy3ed852e2009-09-05 21:47:34 +0000525 }
526 channel_statistics=(ChannelStatistics *) RelinquishMagickMemory(
527 channel_statistics);
cristybd822072010-01-27 00:30:00 +0000528 }
cristybd822072010-01-27 00:30:00 +0000529 if (channel_features != (ChannelFeatures *) NULL)
530 {
cristye0acabf2010-01-30 00:52:38 +0000531 (void) fprintf(file," Channel features (horizontal, vertical, left and right diagonals, average):\n");
cristybd822072010-01-27 00:30:00 +0000532 switch (colorspace)
533 {
534 case RGBColorspace:
535 default:
cristy549a37e2010-01-26 15:24:15 +0000536 {
cristye1897792010-01-29 02:05:50 +0000537 (void) PrintChannelFeatures(file,RedChannel,"Red",channel_features);
538 (void) PrintChannelFeatures(file,GreenChannel,"Green",
cristybd822072010-01-27 00:30:00 +0000539 channel_features);
cristye1897792010-01-29 02:05:50 +0000540 (void) PrintChannelFeatures(file,BlueChannel,"Blue",channel_features);
cristybd822072010-01-27 00:30:00 +0000541 break;
542 }
543 case CMYKColorspace:
544 {
cristye1897792010-01-29 02:05:50 +0000545 (void) PrintChannelFeatures(file,CyanChannel,"Cyan",channel_features);
546 (void) PrintChannelFeatures(file,MagentaChannel,"Magenta",
cristybd822072010-01-27 00:30:00 +0000547 channel_features);
cristye1897792010-01-29 02:05:50 +0000548 (void) PrintChannelFeatures(file,YellowChannel,"Yellow",
cristybd822072010-01-27 00:30:00 +0000549 channel_features);
cristye1897792010-01-29 02:05:50 +0000550 (void) PrintChannelFeatures(file,BlackChannel,"Black",
cristybd822072010-01-27 00:30:00 +0000551 channel_features);
552 break;
553 }
554 case GRAYColorspace:
555 {
cristye1897792010-01-29 02:05:50 +0000556 (void) PrintChannelFeatures(file,GrayChannel,"Gray",channel_features);
cristybd822072010-01-27 00:30:00 +0000557 break;
558 }
559 }
560 if (image->matte != MagickFalse)
cristye1897792010-01-29 02:05:50 +0000561 (void) PrintChannelFeatures(file,AlphaChannel,"Alpha",channel_features);
cristybd822072010-01-27 00:30:00 +0000562 channel_features=(ChannelFeatures *) RelinquishMagickMemory(
563 channel_features);
564 }
565 if (ping == MagickFalse)
566 {
cristy3ed852e2009-09-05 21:47:34 +0000567 if (image->colorspace == CMYKColorspace)
568 (void) fprintf(file," Total ink density: %.0f%%\n",100.0*
569 GetImageTotalInkDensity(image)/(double) QuantumRange);
570 x=0;
571 if (image->matte != MagickFalse)
572 {
573 register const IndexPacket
574 *indexes;
575
576 register const PixelPacket
577 *p;
578
579 p=(PixelPacket *) NULL;
580 indexes=(IndexPacket *) NULL;
581 for (y=0; y < (long) image->rows; y++)
582 {
583 p=GetVirtualPixels(image,0,y,image->columns,1,exception);
584 if (p == (const PixelPacket *) NULL)
585 break;
586 indexes=GetVirtualIndexQueue(image);
587 for (x=0; x < (long) image->columns; x++)
588 {
589 if (p->opacity == (Quantum) TransparentOpacity)
590 break;
591 p++;
592 }
593 if (x < (long) image->columns)
594 break;
595 }
596 if ((x < (long) image->columns) || (y < (long) image->rows))
597 {
598 char
599 tuple[MaxTextExtent];
600
601 MagickPixelPacket
602 pixel;
603
604 GetMagickPixelPacket(image,&pixel);
605 SetMagickPixelPacket(image,p,indexes+x,&pixel);
606 (void) QueryMagickColorname(image,&pixel,SVGCompliance,tuple,
607 &image->exception);
608 (void) fprintf(file," Alpha: %s ",tuple);
609 GetColorTuple(&pixel,MagickTrue,tuple);
610 (void) fprintf(file," %s\n",tuple);
611 }
612 }
cristy549a37e2010-01-26 15:24:15 +0000613 artifact=GetImageArtifact(image,"identify:unique");
614 if ((artifact != (const char *) NULL) &&
615 (IsMagickTrue(artifact) != MagickFalse))
616 (void) fprintf(file," Colors: %lu\n",GetNumberColors(image,
617 (FILE *) NULL,&image->exception));
618 if (IsHistogramImage(image,&image->exception) != MagickFalse)
cristy3ed852e2009-09-05 21:47:34 +0000619 {
cristy549a37e2010-01-26 15:24:15 +0000620 (void) fprintf(file," Histogram:\n");
621 (void) GetNumberColors(image,file,&image->exception);
cristy3ed852e2009-09-05 21:47:34 +0000622 }
623 }
624 if (image->storage_class == PseudoClass)
625 {
626 (void) fprintf(file," Colormap: %lu\n",image->colors);
627 if (image->colors <= 1024)
628 {
629 char
630 color[MaxTextExtent],
631 hex[MaxTextExtent],
632 tuple[MaxTextExtent];
633
634 MagickPixelPacket
635 pixel;
636
637 register PixelPacket
cristyc47d1f82009-11-26 01:44:43 +0000638 *restrict p;
cristy3ed852e2009-09-05 21:47:34 +0000639
640 GetMagickPixelPacket(image,&pixel);
641 p=image->colormap;
642 for (i=0; i < (long) image->colors; i++)
643 {
644 SetMagickPixelPacket(image,p,(IndexPacket *) NULL,&pixel);
645 (void) CopyMagickString(tuple,"(",MaxTextExtent);
646 ConcatenateColorComponent(&pixel,RedChannel,X11Compliance,tuple);
647 (void) ConcatenateMagickString(tuple,",",MaxTextExtent);
648 ConcatenateColorComponent(&pixel,GreenChannel,X11Compliance,tuple);
649 (void) ConcatenateMagickString(tuple,",",MaxTextExtent);
650 ConcatenateColorComponent(&pixel,BlueChannel,X11Compliance,tuple);
651 if (pixel.colorspace == CMYKColorspace)
652 {
653 (void) ConcatenateMagickString(tuple,",",MaxTextExtent);
654 ConcatenateColorComponent(&pixel,IndexChannel,X11Compliance,
655 tuple);
656 }
657 if (pixel.matte != MagickFalse)
658 {
659 (void) ConcatenateMagickString(tuple,",",MaxTextExtent);
660 ConcatenateColorComponent(&pixel,OpacityChannel,X11Compliance,
661 tuple);
662 }
663 (void) ConcatenateMagickString(tuple,")",MaxTextExtent);
664 (void) QueryMagickColorname(image,&pixel,SVGCompliance,color,
665 &image->exception);
666 GetColorTuple(&pixel,MagickTrue,hex);
667 (void) fprintf(file," %8ld: %s %s %s\n",i,tuple,hex,color);
668 p++;
669 }
670 }
671 }
672 if (image->error.mean_error_per_pixel != 0.0)
cristye7f51092010-01-17 00:39:37 +0000673 (void) fprintf(file," Mean error per pixel: %g\n",
cristy3ed852e2009-09-05 21:47:34 +0000674 image->error.mean_error_per_pixel);
675 if (image->error.normalized_mean_error != 0.0)
cristye7f51092010-01-17 00:39:37 +0000676 (void) fprintf(file," Normalized mean error: %g\n",
cristy3ed852e2009-09-05 21:47:34 +0000677 image->error.normalized_mean_error);
678 if (image->error.normalized_maximum_error != 0.0)
cristye7f51092010-01-17 00:39:37 +0000679 (void) fprintf(file," Normalized maximum error: %g\n",
cristy3ed852e2009-09-05 21:47:34 +0000680 image->error.normalized_maximum_error);
681 (void) fprintf(file," Rendering intent: %s\n",MagickOptionToMnemonic(
682 MagickIntentOptions,(long) image->rendering_intent));
683 if (image->gamma != 0.0)
cristye7f51092010-01-17 00:39:37 +0000684 (void) fprintf(file," Gamma: %g\n",image->gamma);
cristy3ed852e2009-09-05 21:47:34 +0000685 if ((image->chromaticity.red_primary.x != 0.0) ||
686 (image->chromaticity.green_primary.x != 0.0) ||
687 (image->chromaticity.blue_primary.x != 0.0) ||
688 (image->chromaticity.white_point.x != 0.0))
689 {
690 /*
691 Display image chromaticity.
692 */
693 (void) fprintf(file," Chromaticity:\n");
cristye7f51092010-01-17 00:39:37 +0000694 (void) fprintf(file," red primary: (%g,%g)\n",
cristy3ed852e2009-09-05 21:47:34 +0000695 image->chromaticity.red_primary.x,image->chromaticity.red_primary.y);
cristye7f51092010-01-17 00:39:37 +0000696 (void) fprintf(file," green primary: (%g,%g)\n",
cristy3ed852e2009-09-05 21:47:34 +0000697 image->chromaticity.green_primary.x,
698 image->chromaticity.green_primary.y);
cristye7f51092010-01-17 00:39:37 +0000699 (void) fprintf(file," blue primary: (%g,%g)\n",
cristy3ed852e2009-09-05 21:47:34 +0000700 image->chromaticity.blue_primary.x,image->chromaticity.blue_primary.y);
cristye7f51092010-01-17 00:39:37 +0000701 (void) fprintf(file," white point: (%g,%g)\n",
cristy3ed852e2009-09-05 21:47:34 +0000702 image->chromaticity.white_point.x,image->chromaticity.white_point.y);
703 }
704 if ((image->extract_info.width*image->extract_info.height) != 0)
705 (void) fprintf(file," Tile geometry: %lux%lu%+ld%+ld\n",
706 image->extract_info.width,image->extract_info.height,
707 image->extract_info.x,image->extract_info.y);
708 (void) fprintf(file," Interlace: %s\n",MagickOptionToMnemonic(
709 MagickInterlaceOptions,(long) image->interlace));
710 (void) QueryColorname(image,&image->background_color,SVGCompliance,color,
711 &image->exception);
712 (void) fprintf(file," Background color: %s\n",color);
713 (void) QueryColorname(image,&image->border_color,SVGCompliance,color,
714 &image->exception);
715 (void) fprintf(file," Border color: %s\n",color);
716 (void) QueryColorname(image,&image->matte_color,SVGCompliance,color,
717 &image->exception);
718 (void) fprintf(file," Matte color: %s\n",color);
719 (void) QueryColorname(image,&image->transparent_color,SVGCompliance,color,
720 &image->exception);
721 (void) fprintf(file," Transparent color: %s\n",color);
cristy11a77682009-10-11 21:50:20 +0000722 (void) fprintf(file," Compose: %s\n",MagickOptionToMnemonic(
723 MagickComposeOptions,(long) image->compose));
cristy3ed852e2009-09-05 21:47:34 +0000724 if ((image->page.width != 0) || (image->page.height != 0) ||
725 (image->page.x != 0) || (image->page.y != 0))
726 (void) fprintf(file," Page geometry: %lux%lu%+ld%+ld\n",image->page.width,
727 image->page.height,image->page.x,image->page.y);
728 if ((image->page.x != 0) || (image->page.y != 0))
729 (void) fprintf(file," Origin geometry: %+ld%+ld\n",image->page.x,
730 image->page.y);
731 (void) fprintf(file," Dispose: %s\n",MagickOptionToMnemonic(
732 MagickDisposeOptions,(long) image->dispose));
733 if (image->delay != 0)
734 (void) fprintf(file," Delay: %lux%ld\n",image->delay,
735 image->ticks_per_second);
736 if (image->iterations != 1)
737 (void) fprintf(file," Iterations: %lu\n",image->iterations);
738 if ((image->next != (Image *) NULL) || (image->previous != (Image *) NULL))
739 (void) fprintf(file," Scene: %lu of %lu\n",image->scene,
740 GetImageListLength(image));
741 else
742 if (image->scene != 0)
743 (void) fprintf(file," Scene: %lu\n",image->scene);
744 (void) fprintf(file," Compression: %s\n",MagickOptionToMnemonic(
745 MagickCompressOptions,(long) image->compression));
746 if (image->quality != UndefinedCompressionQuality)
747 (void) fprintf(file," Quality: %lu\n",image->quality);
748 (void) fprintf(file," Orientation: %s\n",MagickOptionToMnemonic(
749 MagickOrientationOptions,(long) image->orientation));
750 if (image->montage != (char *) NULL)
751 (void) fprintf(file," Montage: %s\n",image->montage);
752 if (image->directory != (char *) NULL)
753 {
754 Image
755 *tile;
756
757 ImageInfo
758 *image_info;
759
760 register char
761 *p,
762 *q;
763
764 WarningHandler
765 handler;
766
767 /*
768 Display visual image directory.
769 */
770 image_info=AcquireImageInfo();
771 (void) CloneString(&image_info->size,"64x64");
772 (void) fprintf(file," Directory:\n");
773 for (p=image->directory; *p != '\0'; p++)
774 {
775 q=p;
776 while ((*q != '\n') && (*q != '\0'))
777 q++;
778 (void) CopyMagickString(image_info->filename,p,(size_t) (q-p+1));
779 p=q;
780 (void) fprintf(file," %s",image_info->filename);
781 handler=SetWarningHandler((WarningHandler) NULL);
782 tile=ReadImage(image_info,&image->exception);
783 (void) SetWarningHandler(handler);
784 if (tile == (Image *) NULL)
785 {
786 (void) fprintf(file,"\n");
787 continue;
788 }
789 (void) fprintf(file," %lux%lu %s\n",tile->magick_columns,
790 tile->magick_rows,tile->magick);
791 (void) SignatureImage(tile);
792 ResetImagePropertyIterator(tile);
793 property=GetNextImageProperty(tile);
794 while (property != (const char *) NULL)
795 {
796 (void) fprintf(file," %s:\n",property);
797 value=GetImageProperty(tile,property);
798 if (value != (const char *) NULL)
799 (void) fprintf(file,"%s\n",value);
800 property=GetNextImageProperty(tile);
801 }
802 tile=DestroyImage(tile);
803 }
804 image_info=DestroyImageInfo(image_info);
805 }
806 (void) GetImageProperty(image,"exif:*");
807 ResetImagePropertyIterator(image);
808 property=GetNextImageProperty(image);
809 if (property != (const char *) NULL)
810 {
811 /*
812 Display image properties.
813 */
814 (void) fprintf(file," Properties:\n");
815 while (property != (const char *) NULL)
816 {
817 (void) fprintf(file," %c",*property);
818 if (strlen(property) > 1)
819 (void) fprintf(file,"%s: ",property+1);
820 if (strlen(property) > 80)
821 (void) fputc('\n',file);
822 value=GetImageProperty(image,property);
823 if (value != (const char *) NULL)
824 (void) fprintf(file,"%s\n",value);
825 property=GetNextImageProperty(image);
826 }
827 }
828 (void) FormatMagickString(key,MaxTextExtent,"8BIM:1999,2998:#1");
829 value=GetImageProperty(image,key);
830 if (value != (const char *) NULL)
831 {
832 /*
833 Display clipping path.
834 */
835 (void) fprintf(file," Clipping path: ");
836 if (strlen(value) > 80)
837 (void) fputc('\n',file);
838 (void) fprintf(file,"%s\n",value);
839 }
840 ResetImageProfileIterator(image);
841 name=GetNextImageProfile(image);
842 if (name != (char *) NULL)
843 {
844 const StringInfo
845 *profile;
846
847 /*
848 Identify image profiles.
849 */
850 (void) fprintf(file," Profiles:\n");
851 while (name != (char *) NULL)
852 {
853 profile=GetImageProfile(image,name);
854 if (profile == (StringInfo *) NULL)
855 continue;
856 (void) fprintf(file," Profile-%s: %lu bytes\n",name,(unsigned long)
857 GetStringInfoLength(profile));
858#if defined(MAGICKCORE_LCMS_DELEGATE)
859 if ((LocaleCompare(name,"icc") == 0) ||
860 (LocaleCompare(name,"icm") == 0))
861 {
862 cmsHPROFILE
863 icc_profile;
864
865 icc_profile=cmsOpenProfileFromMem(GetStringInfoDatum(profile),
866 (DWORD) GetStringInfoLength(profile));
867 if (icc_profile != (cmsHPROFILE *) NULL)
868 {
869 const char
870 *name;
871
872 name=cmsTakeProductName(icc_profile);
873 if (name != (const char *) NULL)
874 (void) fprintf(file," %s\n",name);
875 (void) cmsCloseProfile(icc_profile);
876 }
877 }
878#endif
879 if (LocaleCompare(name,"iptc") == 0)
880 {
881 char
882 *attribute,
883 **attribute_list;
884
885 const char
886 *tag;
887
888 long
889 dataset,
890 record,
891 sentinel;
892
893 register long
894 j;
895
896 size_t
897 length,
898 profile_length;
899
900 profile_length=GetStringInfoLength(profile);
901 for (i=0; i < (long) profile_length; i+=(long) length)
902 {
903 length=1;
904 sentinel=GetStringInfoDatum(profile)[i++];
905 if (sentinel != 0x1c)
906 continue;
907 dataset=GetStringInfoDatum(profile)[i++];
908 record=GetStringInfoDatum(profile)[i++];
909 switch (record)
910 {
911 case 5: tag="Image Name"; break;
912 case 7: tag="Edit Status"; break;
913 case 10: tag="Priority"; break;
914 case 15: tag="Category"; break;
915 case 20: tag="Supplemental Category"; break;
916 case 22: tag="Fixture Identifier"; break;
917 case 25: tag="Keyword"; break;
918 case 30: tag="Release Date"; break;
919 case 35: tag="Release Time"; break;
920 case 40: tag="Special Instructions"; break;
921 case 45: tag="Reference Service"; break;
922 case 47: tag="Reference Date"; break;
923 case 50: tag="Reference Number"; break;
924 case 55: tag="Created Date"; break;
925 case 60: tag="Created Time"; break;
926 case 65: tag="Originating Program"; break;
927 case 70: tag="Program Version"; break;
928 case 75: tag="Object Cycle"; break;
929 case 80: tag="Byline"; break;
930 case 85: tag="Byline Title"; break;
931 case 90: tag="City"; break;
932 case 95: tag="Province State"; break;
933 case 100: tag="Country Code"; break;
934 case 101: tag="Country"; break;
935 case 103: tag="Original Transmission Reference"; break;
936 case 105: tag="Headline"; break;
937 case 110: tag="Credit"; break;
938 case 115: tag="Src"; break;
939 case 116: tag="Copyright String"; break;
940 case 120: tag="Caption"; break;
941 case 121: tag="Local Caption"; break;
942 case 122: tag="Caption Writer"; break;
943 case 200: tag="Custom Field 1"; break;
944 case 201: tag="Custom Field 2"; break;
945 case 202: tag="Custom Field 3"; break;
946 case 203: tag="Custom Field 4"; break;
947 case 204: tag="Custom Field 5"; break;
948 case 205: tag="Custom Field 6"; break;
949 case 206: tag="Custom Field 7"; break;
950 case 207: tag="Custom Field 8"; break;
951 case 208: tag="Custom Field 9"; break;
952 case 209: tag="Custom Field 10"; break;
953 case 210: tag="Custom Field 11"; break;
954 case 211: tag="Custom Field 12"; break;
955 case 212: tag="Custom Field 13"; break;
956 case 213: tag="Custom Field 14"; break;
957 case 214: tag="Custom Field 15"; break;
958 case 215: tag="Custom Field 16"; break;
959 case 216: tag="Custom Field 17"; break;
960 case 217: tag="Custom Field 18"; break;
961 case 218: tag="Custom Field 19"; break;
962 case 219: tag="Custom Field 20"; break;
963 default: tag="unknown"; break;
964 }
965 (void) fprintf(file," %s[%ld,%ld]: ",tag,dataset,record);
966 length=(size_t) (GetStringInfoDatum(profile)[i++] << 8);
967 length|=GetStringInfoDatum(profile)[i++];
968 attribute=(char *) NULL;
969 if (~length >= MaxTextExtent)
970 attribute=(char *) AcquireQuantumMemory(length+
971 MaxTextExtent,sizeof(*attribute));
972 if (attribute != (char *) NULL)
973 {
974 (void) CopyMagickString(attribute,(char *)
975 GetStringInfoDatum(profile)+i,length+1);
976 attribute_list=StringToList(attribute);
977 if (attribute_list != (char **) NULL)
978 {
979 for (j=0; attribute_list[j] != (char *) NULL; j++)
980 {
981 (void) fputs(attribute_list[j],file);
982 (void) fputs("\n",file);
983 attribute_list[j]=(char *) RelinquishMagickMemory(
984 attribute_list[j]);
985 }
986 attribute_list=(char **) RelinquishMagickMemory(
987 attribute_list);
988 }
989 attribute=DestroyString(attribute);
990 }
991 }
992 }
993 if (image->debug != MagickFalse)
994 PrintStringInfo(file,name,profile);
995 name=GetNextImageProfile(image);
996 }
997 }
998 ResetImageArtifactIterator(image);
999 artifact=GetNextImageArtifact(image);
1000 if (artifact != (const char *) NULL)
1001 {
1002 /*
1003 Display image artifacts.
1004 */
1005 (void) fprintf(file," Artifacts:\n");
1006 while (artifact != (const char *) NULL)
1007 {
1008 (void) fprintf(file," %c",*artifact);
1009 if (strlen(artifact) > 1)
1010 (void) fprintf(file,"%s: ",artifact+1);
1011 if (strlen(artifact) > 80)
1012 (void) fputc('\n',file);
1013 value=GetImageArtifact(image,artifact);
1014 if (value != (const char *) NULL)
1015 (void) fprintf(file,"%s\n",value);
1016 artifact=GetNextImageArtifact(image);
1017 }
1018 }
1019 ResetImageRegistryIterator();
1020 registry=GetNextImageRegistry();
1021 if (registry != (const char *) NULL)
1022 {
1023 /*
1024 Display image registry.
1025 */
1026 (void) fprintf(file," Registry:\n");
1027 while (registry != (const char *) NULL)
1028 {
1029 (void) fprintf(file," %c",*registry);
1030 if (strlen(registry) > 1)
1031 (void) fprintf(file,"%s: ",registry+1);
1032 if (strlen(registry) > 80)
1033 (void) fputc('\n',file);
1034 value=(const char *) GetImageRegistry(StringRegistryType,registry,
1035 &image->exception);
1036 if (value != (const char *) NULL)
1037 (void) fprintf(file,"%s\n",value);
1038 registry=GetNextImageRegistry();
1039 }
1040 }
1041 (void) fprintf(file," Tainted: %s\n",MagickOptionToMnemonic(
1042 MagickBooleanOptions,(long) image->taint));
cristyb9080c92009-12-01 20:13:26 +00001043 (void) FormatMagickSize(GetBlobSize(image),MagickFalse,format);
cristy3ed852e2009-09-05 21:47:34 +00001044 (void) fprintf(file," Filesize: %s\n",format);
cristyb9080c92009-12-01 20:13:26 +00001045 (void) FormatMagickSize((MagickSizeType) image->columns*image->rows,
1046 MagickFalse,format);
cristy3ed852e2009-09-05 21:47:34 +00001047 (void) fprintf(file," Number pixels: %s\n",format);
cristy3d231692009-09-29 01:05:22 +00001048 (void) FormatMagickSize((MagickSizeType) ((double) image->columns*image->rows/
cristyb9080c92009-12-01 20:13:26 +00001049 elapsed_time+0.5),MagickFalse,format);
cristy3d231692009-09-29 01:05:22 +00001050 (void) fprintf(file," Pixels per second: %s\n",format);
1051 (void) fprintf(file," User time: %0.3fu\n",user_time);
1052 (void) fprintf(file," Elapsed time: %ld:%02ld.%03ld\n",(long)
1053 (elapsed_time/60.0),(long) ceil(fmod(elapsed_time,60.0)),(long)
1054 (1000.0*(elapsed_time-floor(elapsed_time))));
1055 (void) fprintf(file," Version: %s\n",GetMagickVersion((unsigned long *)
1056 NULL));
cristy3ed852e2009-09-05 21:47:34 +00001057 (void) fflush(file);
1058 return(ferror(file) != 0 ? MagickFalse : MagickTrue);
1059}