46 #include "magick/studio.h"
47 #include "magick/annotate.h"
48 #include "magick/artifact.h"
49 #include "magick/attribute.h"
50 #include "magick/blob.h"
51 #include "magick/blob-private.h"
52 #include "magick/cache.h"
53 #include "magick/client.h"
54 #include "magick/coder.h"
55 #include "magick/color.h"
56 #include "magick/configure.h"
57 #include "magick/constitute.h"
58 #include "magick/constitute-private.h"
59 #include "magick/decorate.h"
60 #include "magick/delegate.h"
61 #include "magick/draw.h"
62 #include "magick/effect.h"
63 #include "magick/exception.h"
64 #include "magick/exception-private.h"
65 #include "magick/feature.h"
66 #include "magick/gem.h"
67 #include "magick/geometry.h"
68 #include "magick/histogram.h"
69 #include "magick/identify.h"
70 #include "magick/image.h"
71 #include "magick/image-private.h"
72 #include "magick/list.h"
73 #include "magick/locale_.h"
74 #include "magick/log.h"
75 #include "magick/magic.h"
76 #include "magick/magick.h"
77 #include "magick/memory_.h"
78 #include "magick/module.h"
79 #include "magick/monitor.h"
80 #include "magick/montage.h"
81 #include "magick/option.h"
82 #include "magick/pixel-private.h"
83 #include "magick/prepress.h"
84 #include "magick/profile.h"
85 #include "magick/property.h"
86 #include "magick/quantize.h"
87 #include "magick/quantum.h"
88 #include "magick/random_.h"
89 #include "magick/registry.h"
90 #include "magick/resize.h"
91 #include "magick/resource_.h"
92 #include "magick/signature.h"
93 #include "magick/statistic.h"
94 #include "magick/string_.h"
95 #include "magick/string-private.h"
96 #include "magick/timer.h"
97 #include "magick/timer-private.h"
98 #include "magick/token.h"
99 #include "magick/utility.h"
100 #include "magick/version.h"
147 assert(image != (
Image *) NULL);
148 assert(image->signature == MagickCoreSignature);
149 if (IsEventLogging() != MagickFalse)
150 (void) LogMagickEvent(TraceEvent,GetMagickModule(),
"%s",image->filename);
151 length=CompositeChannels+1UL;
153 sizeof(*channel_statistics));
155 ThrowFatalException(ResourceLimitFatalError,
"MemoryAllocationFailed");
156 (void) memset(channel_statistics,0,length*
157 sizeof(*channel_statistics));
158 for (i=0; i <= (ssize_t) CompositeChannels; i++)
162 case MaximumStatistic:
165 channel_statistics[i].maxima=(-MagickMaximumValue);
168 case MinimumStatistic:
170 channel_statistics[i].minima=MagickMaximumValue;
175 for (y=0; y < (ssize_t) image->rows; y++)
178 *magick_restrict indexes;
186 p=GetVirtualPixels(image,0,y,image->columns,1,exception);
189 indexes=GetVirtualIndexQueue(image);
190 for (x=0; x < (ssize_t) image->columns; x++)
194 case MaximumStatistic:
197 if ((
double) GetPixelRed(p) > channel_statistics[RedChannel].maxima)
198 channel_statistics[RedChannel].maxima=(
double) GetPixelRed(p);
199 if ((
double) GetPixelGreen(p) > channel_statistics[GreenChannel].maxima)
200 channel_statistics[GreenChannel].maxima=(double) GetPixelGreen(p);
201 if ((
double) GetPixelBlue(p) > channel_statistics[BlueChannel].maxima)
202 channel_statistics[BlueChannel].maxima=(
double) GetPixelBlue(p);
203 if ((image->matte != MagickFalse) &&
204 ((
double) GetPixelOpacity(p) > channel_statistics[OpacityChannel].maxima))
205 channel_statistics[OpacityChannel].maxima=(double)
207 if ((image->colorspace == CMYKColorspace) &&
208 ((double) GetPixelIndex(indexes+x) > channel_statistics[BlackChannel].maxima))
209 channel_statistics[BlackChannel].maxima=(double)
210 GetPixelIndex(indexes+x);
213 case MinimumStatistic:
215 if ((
double) GetPixelRed(p) < channel_statistics[RedChannel].minima)
216 channel_statistics[RedChannel].minima=(
double) GetPixelRed(p);
217 if ((
double) GetPixelGreen(p) < channel_statistics[GreenChannel].minima)
218 channel_statistics[GreenChannel].minima=(double) GetPixelGreen(p);
219 if ((
double) GetPixelBlue(p) < channel_statistics[BlueChannel].minima)
220 channel_statistics[BlueChannel].minima=(
double) GetPixelBlue(p);
221 if ((image->matte != MagickFalse) &&
222 ((
double) GetPixelOpacity(p) < channel_statistics[OpacityChannel].minima))
223 channel_statistics[OpacityChannel].minima=(double)
225 if ((image->colorspace == CMYKColorspace) &&
226 ((double) GetPixelIndex(indexes+x) < channel_statistics[BlackChannel].minima))
227 channel_statistics[BlackChannel].minima=(double)
228 GetPixelIndex(indexes+x);
235 return(channel_statistics);
238 static ssize_t PrintChannelFeatures(FILE *file,
const ChannelType channel,
241 #define PrintFeature(feature) \
242 GetMagickPrecision(),(feature)[0], \
243 GetMagickPrecision(),(feature)[1], \
244 GetMagickPrecision(),(feature)[2], \
245 GetMagickPrecision(),(feature)[3], \
246 GetMagickPrecision(),((feature)[0]+(feature)[1]+(feature)[2]+(feature)[3])/4.0 \
248 #define FeaturesFormat " %s:\n" \
249 " Angular Second Moment:\n" \
250 " %.*g, %.*g, %.*g, %.*g, %.*g\n" \
252 " %.*g, %.*g, %.*g, %.*g, %.*g\n" \
254 " %.*g, %.*g, %.*g, %.*g, %.*g\n" \
255 " Sum of Squares Variance:\n" \
256 " %.*g, %.*g, %.*g, %.*g, %.*g\n" \
257 " Inverse Difference Moment:\n" \
258 " %.*g, %.*g, %.*g, %.*g, %.*g\n" \
260 " %.*g, %.*g, %.*g, %.*g, %.*g\n" \
262 " %.*g, %.*g, %.*g, %.*g, %.*g\n" \
264 " %.*g, %.*g, %.*g, %.*g, %.*g\n" \
266 " %.*g, %.*g, %.*g, %.*g, %.*g\n" \
267 " Difference Variance:\n" \
268 " %.*g, %.*g, %.*g, %.*g, %.*g\n" \
269 " Difference Entropy:\n" \
270 " %.*g, %.*g, %.*g, %.*g, %.*g\n" \
271 " Information Measure of Correlation 1:\n" \
272 " %.*g, %.*g, %.*g, %.*g, %.*g\n" \
273 " Information Measure of Correlation 2:\n" \
274 " %.*g, %.*g, %.*g, %.*g, %.*g\n" \
275 " Maximum Correlation Coefficient:\n" \
276 " %.*g, %.*g, %.*g, %.*g, %.*g\n"
281 n=FormatLocaleFile(file,FeaturesFormat,name,
282 PrintFeature(channel_features[channel].angular_second_moment),
283 PrintFeature(channel_features[channel].contrast),
284 PrintFeature(channel_features[channel].correlation),
285 PrintFeature(channel_features[channel].variance_sum_of_squares),
286 PrintFeature(channel_features[channel].inverse_difference_moment),
287 PrintFeature(channel_features[channel].sum_average),
288 PrintFeature(channel_features[channel].sum_variance),
289 PrintFeature(channel_features[channel].sum_entropy),
290 PrintFeature(channel_features[channel].entropy),
291 PrintFeature(channel_features[channel].difference_variance),
292 PrintFeature(channel_features[channel].difference_entropy),
293 PrintFeature(channel_features[channel].measure_of_correlation_1),
294 PrintFeature(channel_features[channel].measure_of_correlation_2),
295 PrintFeature(channel_features[channel].maximum_correlation_coefficient));
299 static ssize_t PrintChannelLocations(FILE *file,
const Image *image,
300 const ChannelType channel,
const char *name,
const StatisticType type,
315 case MaximumStatistic:
318 target=channel_statistics[channel].maxima;
323 target=channel_statistics[channel].mean;
326 case MinimumStatistic:
328 target=channel_statistics[channel].minima;
332 (void) FormatLocaleFile(file,
" %s: %.*g (%.*g)",name,GetMagickPrecision(),
333 target,GetMagickPrecision(),QuantumScale*target);
334 exception=AcquireExceptionInfo();
336 for (y=0; y < (ssize_t) image->rows; y++)
344 p=GetVirtualPixels(image,0,y,image->columns,1,exception);
347 for (x=0; x < (ssize_t) image->columns; x++)
357 match=fabs((
double) p->red-target) < MagickEpsilon ? MagickTrue :
363 match=fabs((
double) p->green-target) < MagickEpsilon ? MagickTrue :
369 match=fabs((
double) p->blue-target) < MagickEpsilon ? MagickTrue :
375 match=fabs((
double) p->opacity-target) < MagickEpsilon ? MagickTrue :
382 if (match != MagickFalse)
384 if ((max_locations != 0) && (n >= (ssize_t) max_locations))
386 (void) FormatLocaleFile(file,
" %.20g,%.20g",(
double) x,(double) y);
391 if (x < (ssize_t) image->columns)
394 (void) FormatLocaleFile(file,
"\n");
398 static ssize_t PrintChannelMoments(FILE *file,
const ChannelType channel,
399 const char *name,
const double scale,
const ChannelMoments *channel_moments)
402 powers[MaximumNumberOfImageMoments] =
403 { 1.0, 2.0, 3.0, 3.0, 6.0, 4.0, 6.0, 4.0 };
411 n=FormatLocaleFile(file,
" %s:\n",name);
412 n+=FormatLocaleFile(file,
" Centroid: %.*g,%.*g\n",
413 GetMagickPrecision(),channel_moments[channel].centroid.x,
414 GetMagickPrecision(),channel_moments[channel].centroid.y);
415 n+=FormatLocaleFile(file,
" Ellipse Semi-Major/Minor axis: %.*g,%.*g\n",
416 GetMagickPrecision(),channel_moments[channel].ellipse_axis.x,
417 GetMagickPrecision(),channel_moments[channel].ellipse_axis.y);
418 n+=FormatLocaleFile(file,
" Ellipse angle: %.*g\n",
419 GetMagickPrecision(),channel_moments[channel].ellipse_angle);
420 n+=FormatLocaleFile(file,
" Ellipse eccentricity: %.*g\n",
421 GetMagickPrecision(),channel_moments[channel].ellipse_eccentricity);
422 n+=FormatLocaleFile(file,
" Ellipse intensity: %.*g (%.*g)\n",
423 GetMagickPrecision(),pow(scale,powers[0])*
424 channel_moments[channel].ellipse_intensity,GetMagickPrecision(),
425 channel_moments[channel].ellipse_intensity);
426 for (i=0; i < MaximumNumberOfImageMoments; i++)
427 n+=FormatLocaleFile(file,
" I%.20g: %.*g (%.*g)\n",i+1.0,
428 GetMagickPrecision(),channel_moments[channel].I[i]/pow(scale,powers[i]),
429 GetMagickPrecision(),channel_moments[channel].I[i]);
433 static ssize_t PrintChannelPerceptualHash(FILE *file,
const ChannelType channel,
442 n=FormatLocaleFile(file,
" %s:\n",name);
443 for (i=0; i < MaximumNumberOfPerceptualHashes; i++)
444 n+=FormatLocaleFile(file,
" PH%.20g: %.*g, %.*g\n",i+1.0,
445 GetMagickPrecision(),channel_phash[channel].P[i],
446 GetMagickPrecision(),channel_phash[channel].Q[i]);
450 static ssize_t PrintChannelStatistics(FILE *file,
const ChannelType channel,
451 const char *name,
const double scale,
454 #define StatisticsFormat " %s:\n min: %.*g (%.*g)\n " \
455 "max: %.*g (%.*g)\n mean: %.*g (%.*g)\n " \
456 "standard deviation: %.*g (%.*g)\n kurtosis: %.*g\n " \
457 "skewness: %.*g\n entropy: %.*g\n"
462 n=FormatLocaleFile(file,StatisticsFormat,name,GetMagickPrecision(),
463 (
double) ClampToQuantum((MagickRealType) (scale*
464 channel_statistics[channel].minima)),GetMagickPrecision(),
465 channel_statistics[channel].minima/(
double) QuantumRange,
466 GetMagickPrecision(),(
double) ClampToQuantum((MagickRealType) (scale*
467 channel_statistics[channel].maxima)),GetMagickPrecision(),
468 channel_statistics[channel].maxima/(
double) QuantumRange,
469 GetMagickPrecision(),scale*channel_statistics[channel].mean,
470 GetMagickPrecision(),channel_statistics[channel].mean/(
double) QuantumRange,
471 GetMagickPrecision(),scale*channel_statistics[channel].standard_deviation,
472 GetMagickPrecision(),channel_statistics[channel].standard_deviation/
473 (
double) QuantumRange,GetMagickPrecision(),
474 channel_statistics[channel].kurtosis,GetMagickPrecision(),
475 channel_statistics[channel].skewness,GetMagickPrecision(),
476 channel_statistics[channel].entropy);
480 MagickExport MagickBooleanType IdentifyImage(
Image *image,FILE *file,
481 const MagickBooleanType verbose)
484 color[MaxTextExtent],
485 format[MaxTextExtent],
546 assert(image != (
Image *) NULL);
547 assert(image->signature == MagickCoreSignature);
548 if (IsEventLogging() != MagickFalse)
549 (void) LogMagickEvent(TraceEvent,GetMagickModule(),
"%s",image->filename);
550 if (file == (FILE *) NULL)
552 exception=AcquireExceptionInfo();
553 colorspace=image->colorspace;
554 locate=GetImageArtifact(image,
"identify:locate");
555 if (locate != (
const char *) NULL)
569 statistic_type=(StatisticType) ParseCommandOption(MagickStatisticOptions,
571 limit=GetImageArtifact(image,
"identify:limit");
573 if (limit != (
const char *) NULL)
574 max_locations=StringToUnsignedLong(limit);
575 channel_statistics=GetLocationStatistics(image,statistic_type,exception);
578 (void) FormatLocaleFile(file,
" Channel %s locations:\n",locate);
584 (void) PrintChannelLocations(file,image,RedChannel,
"Red",
585 statistic_type,max_locations,channel_statistics);
586 (void) PrintChannelLocations(file,image,GreenChannel,
"Green",
587 statistic_type,max_locations,channel_statistics);
588 (void) PrintChannelLocations(file,image,BlueChannel,
"Blue",
589 statistic_type,max_locations,channel_statistics);
594 (void) PrintChannelLocations(file,image,CyanChannel,
"Cyan",
595 statistic_type,max_locations,channel_statistics);
596 (void) PrintChannelLocations(file,image,MagentaChannel,
"Magenta",
597 statistic_type,max_locations,channel_statistics);
598 (void) PrintChannelLocations(file,image,YellowChannel,
"Yellow",
599 statistic_type,max_locations,channel_statistics);
600 (void) PrintChannelLocations(file,image,BlackChannel,
"Black",
601 statistic_type,max_locations,channel_statistics);
604 case LinearGRAYColorspace:
607 (void) PrintChannelLocations(file,image,GrayChannel,
"Gray",
608 statistic_type,max_locations,channel_statistics);
612 if (image->matte != MagickFalse)
613 (void) PrintChannelLocations(file,image,AlphaChannel,
"Alpha",
614 statistic_type,max_locations,channel_statistics);
617 exception=DestroyExceptionInfo(exception);
618 return(ferror(file) != 0 ? MagickFalse : MagickTrue);
621 elapsed_time=GetElapsedTime(&image->timer);
622 user_time=GetUserTime(&image->timer);
623 GetTimerInfo(&image->timer);
624 if (verbose == MagickFalse)
629 if (*image->magick_filename !=
'\0')
630 if (LocaleCompare(image->magick_filename,image->filename) != 0)
631 (void) FormatLocaleFile(file,
"%s=>",image->magick_filename);
632 if ((GetPreviousImageInList(image) == (
Image *) NULL) &&
633 (GetNextImageInList(image) == (
Image *) NULL) && (image->scene == 0))
634 (void) FormatLocaleFile(file,
"%s ",image->filename);
636 (
void) FormatLocaleFile(file,
"%s[%.20g] ",image->filename,(
double)
638 (void) FormatLocaleFile(file,
"%s ",image->magick);
639 if ((image->magick_columns != 0) || (image->magick_rows != 0))
640 if ((image->magick_columns != image->columns) ||
641 (image->magick_rows != image->rows))
642 (void) FormatLocaleFile(file,
"%.20gx%.20g=>",(
double)
643 image->magick_columns,(double) image->magick_rows);
644 (void) FormatLocaleFile(file,
"%.20gx%.20g ",(
double) image->columns,
645 (double) image->rows);
646 if ((image->page.width != 0) || (image->page.height != 0) ||
647 (image->page.x != 0) || (image->page.y != 0))
648 (void) FormatLocaleFile(file,
"%.20gx%.20g%+.20g%+.20g ",(
double)
649 image->page.width,(double) image->page.height,(
double) image->page.x,
650 (double) image->page.y);
651 (void) FormatLocaleFile(file,
"%.20g-bit ",(
double) image->depth);
652 if (image->type != UndefinedType)
653 (void) FormatLocaleFile(file,
"%s ",CommandOptionToMnemonic(
654 MagickTypeOptions,(ssize_t) image->type));
655 if (colorspace != UndefinedColorspace)
656 (void) FormatLocaleFile(file,
"%s ",CommandOptionToMnemonic(
657 MagickColorspaceOptions,(ssize_t) colorspace));
658 if (image->storage_class == DirectClass)
660 if (image->total_colors != 0)
662 (void) FormatMagickSize(image->total_colors,MagickFalse,format);
663 (void) FormatLocaleFile(file,
"%s ",format);
667 if (image->total_colors <= image->colors)
668 (void) FormatLocaleFile(file,
"%.20gc ",(
double) image->colors);
670 (
void) FormatLocaleFile(file,
"%.20g=>%.20gc ",(
double)
671 image->total_colors,(
double) image->colors);
672 if (image->error.mean_error_per_pixel != 0.0)
673 (void) FormatLocaleFile(file,
"%.20g/%f/%fdb ",(
double)
674 (image->error.mean_error_per_pixel+0.5),
675 image->error.normalized_mean_error,
676 image->error.normalized_maximum_error);
677 if (image->extent != 0)
679 (void) FormatMagickSize(image->extent,MagickTrue,format);
680 (void) FormatLocaleFile(file,
"%s ",format);
682 (void) FormatLocaleFile(file,
"%0.3fu %lu:%02lu.%03lu",user_time,
683 (
unsigned long) (elapsed_time/60.0),(
unsigned long) floor(fmod(
684 elapsed_time,60.0)),(
unsigned long) (1000.0*(elapsed_time-
685 floor(elapsed_time))));
686 (void) FormatLocaleFile(file,
"\n");
688 exception=DestroyExceptionInfo(exception);
689 return(ferror(file) != 0 ? MagickFalse : MagickTrue);
694 pixels=GetVirtualPixels(image,0,0,1,1,exception);
695 exception=DestroyExceptionInfo(exception);
696 ping=pixels == (
const PixelPacket *) NULL ? MagickTrue : MagickFalse;
697 exception=(&image->exception);
698 (void) SignatureImage(image);
704 if (ping == MagickFalse)
706 depth=GetImageDepth(image,exception);
707 channel_statistics=GetImageChannelStatistics(image,exception);
710 artifact=GetImageArtifact(image,
"identify:moments");
711 if (artifact != (
const char *) NULL)
713 channel_moments=GetImageChannelMoments(image,exception);
714 channel_phash=GetImageChannelPerceptualHash(image,exception);
716 artifact=GetImageArtifact(image,
"identify:features");
717 if (artifact != (
const char *) NULL)
719 distance=StringToUnsignedLong(artifact);
720 channel_features=GetImageChannelFeatures(image,distance,exception);
723 (void) FormatLocaleFile(file,
"Image:\n Filename: %s\n",image->filename);
724 if (*image->magick_filename !=
'\0')
725 if (LocaleCompare(image->magick_filename,image->filename) != 0)
728 filename[MaxTextExtent];
730 GetPathComponent(image->magick_filename,TailPath,filename);
731 (void) FormatLocaleFile(file,
" Base filename: %s\n",filename);
733 properties=(*GetBlobProperties(image));
734 if (properties.st_mode != 0)
736 static const char *rwx[] =
737 {
"---",
"--x",
"-w-",
"-wx",
"r--",
"r-x",
"rw-",
"rwx"};
738 (void) FormatLocaleFile(file,
" Permissions: %s%s%s\n",
739 rwx[(properties.st_mode >> 6) & 0x07],
740 rwx[(properties.st_mode >> 3) & 0x07],
741 rwx[(properties.st_mode >> 0) & 0x07]);
743 magick_info=GetMagickInfo(image->magick,exception);
744 if ((magick_info == (
const MagickInfo *) NULL) ||
745 (GetMagickDescription(magick_info) == (
const char *) NULL))
746 (void) FormatLocaleFile(file,
" Format: %s\n",image->magick);
748 (
void) FormatLocaleFile(file,
" Format: %s (%s)\n",image->magick,
749 GetMagickDescription(magick_info));
750 if ((magick_info != (
const MagickInfo *) NULL) &&
751 (GetMagickMimeType(magick_info) != (
const char *) NULL))
752 (void) FormatLocaleFile(file,
" Mime type: %s\n",GetMagickMimeType(
754 (void) FormatLocaleFile(file,
" Class: %s\n",CommandOptionToMnemonic(
755 MagickClassOptions,(ssize_t) image->storage_class));
756 (void) FormatLocaleFile(file,
" Geometry: %.20gx%.20g%+.20g%+.20g\n",(
double)
757 image->columns,(double) image->rows,(
double) image->tile_offset.x,(double)
758 image->tile_offset.y);
759 if ((image->magick_columns != 0) || (image->magick_rows != 0))
760 if ((image->magick_columns != image->columns) ||
761 (image->magick_rows != image->rows))
762 (void) FormatLocaleFile(file,
" Base geometry: %.20gx%.20g\n",(
double)
763 image->magick_columns,(double) image->magick_rows);
764 if ((image->x_resolution != 0.0) && (image->y_resolution != 0.0))
766 (void) FormatLocaleFile(file,
" Resolution: %gx%g\n",image->x_resolution,
767 image->y_resolution);
768 (void) FormatLocaleFile(file,
" Print size: %gx%g\n",(
double)
769 image->columns/image->x_resolution,(double) image->rows/
770 image->y_resolution);
772 (void) FormatLocaleFile(file,
" Units: %s\n",CommandOptionToMnemonic(
773 MagickResolutionOptions,(ssize_t) image->units));
774 (void) FormatLocaleFile(file,
" Colorspace: %s\n",CommandOptionToMnemonic(
775 MagickColorspaceOptions,(ssize_t) colorspace));
776 type=IdentifyImageType(image,exception);
777 (void) FormatLocaleFile(file,
" Type: %s\n",CommandOptionToMnemonic(
778 MagickTypeOptions,(ssize_t) type));
779 if (image->type != type)
780 (void) FormatLocaleFile(file,
" Base type: %s\n",CommandOptionToMnemonic(
781 MagickTypeOptions,(ssize_t) image->type));
782 (void) FormatLocaleFile(file,
" Endianness: %s\n",CommandOptionToMnemonic(
783 MagickEndianOptions,(ssize_t) image->endian));
786 if (image->depth == depth)
787 (void) FormatLocaleFile(file,
" Depth: %.20g-bit\n",(
double)
790 (
void) FormatLocaleFile(file,
" Depth: %.20g/%.20g-bit\n",(
double)
791 image->depth,(
double) depth);
798 (void) FormatLocaleFile(file,
" Channel depth:\n");
804 (void) FormatLocaleFile(file,
" red: %.20g-bit\n",(
double)
805 channel_statistics[RedChannel].depth);
806 (void) FormatLocaleFile(file,
" green: %.20g-bit\n",(
double)
807 channel_statistics[GreenChannel].depth);
808 (void) FormatLocaleFile(file,
" blue: %.20g-bit\n",(
double)
809 channel_statistics[BlueChannel].depth);
814 (void) FormatLocaleFile(file,
" cyan: %.20g-bit\n",(
double)
815 channel_statistics[CyanChannel].depth);
816 (void) FormatLocaleFile(file,
" magenta: %.20g-bit\n",(
double)
817 channel_statistics[MagentaChannel].depth);
818 (void) FormatLocaleFile(file,
" yellow: %.20g-bit\n",(
double)
819 channel_statistics[YellowChannel].depth);
820 (void) FormatLocaleFile(file,
" black: %.20g-bit\n",(
double)
821 channel_statistics[BlackChannel].depth);
824 case LinearGRAYColorspace:
827 (void) FormatLocaleFile(file,
" gray: %.20g-bit\n",(
double)
828 channel_statistics[GrayChannel].depth);
832 if (image->matte != MagickFalse)
833 (void) FormatLocaleFile(file,
" alpha: %.20g-bit\n",(
double)
834 channel_statistics[OpacityChannel].depth);
836 if (image->depth <= MAGICKCORE_QUANTUM_DEPTH)
837 scale=(double) QuantumRange/((
size_t) QuantumRange >> ((size_t)
838 MAGICKCORE_QUANTUM_DEPTH-image->depth));
839 (void) FormatLocaleFile(file,
" Channel statistics:\n");
840 (void) FormatLocaleFile(file,
" Pixels: %.20g\n",(
double)
841 image->columns*image->rows);
847 (void) PrintChannelStatistics(file,RedChannel,
"Red",1.0/scale,
849 (void) PrintChannelStatistics(file,GreenChannel,
"Green",1.0/scale,
851 (void) PrintChannelStatistics(file,BlueChannel,
"Blue",1.0/scale,
857 (void) PrintChannelStatistics(file,CyanChannel,
"Cyan",1.0/scale,
859 (void) PrintChannelStatistics(file,MagentaChannel,
"Magenta",1.0/scale,
861 (void) PrintChannelStatistics(file,YellowChannel,
"Yellow",1.0/scale,
863 (void) PrintChannelStatistics(file,BlackChannel,
"Black",1.0/scale,
867 case LinearGRAYColorspace:
870 (void) PrintChannelStatistics(file,GrayChannel,
"Gray",1.0/scale,
875 if (image->matte != MagickFalse)
876 (void) PrintChannelStatistics(file,AlphaChannel,
"Alpha",1.0/scale,
878 if ((colorspace != LinearGRAYColorspace) && (colorspace != GRAYColorspace))
880 (void) FormatLocaleFile(file,
" Image statistics:\n");
881 (void) PrintChannelStatistics(file,CompositeChannels,
"Overall",1.0/
882 scale,channel_statistics);
889 scale=(double) ((1UL << image->depth)-1);
890 (void) FormatLocaleFile(file,
" Channel Hu moments:\n");
896 (void) PrintChannelMoments(file,RedChannel,
"Red",scale,
898 (void) PrintChannelMoments(file,GreenChannel,
"Green",scale,
900 (void) PrintChannelMoments(file,BlueChannel,
"Blue",scale,
906 (void) PrintChannelMoments(file,CyanChannel,
"Cyan",scale,
908 (void) PrintChannelMoments(file,MagentaChannel,
"Magenta",scale,
910 (void) PrintChannelMoments(file,YellowChannel,
"Yellow",scale,
912 (void) PrintChannelMoments(file,BlackChannel,
"Black",scale,
916 case LinearGRAYColorspace:
919 (void) PrintChannelMoments(file,GrayChannel,
"Gray",scale,
924 if (image->matte != MagickFalse)
925 (void) PrintChannelMoments(file,AlphaChannel,
"Alpha",scale,
927 if ((colorspace != LinearGRAYColorspace) && (colorspace != GRAYColorspace))
929 (void) FormatLocaleFile(file,
" Image moments:\n");
930 (void) PrintChannelMoments(file,CompositeChannels,
"Overall",scale,
938 (void) FormatLocaleFile(file,
" Channel perceptual hash:\n");
939 (void) PrintChannelPerceptualHash(file,RedChannel,
"Red, Hue",
941 (void) PrintChannelPerceptualHash(file,GreenChannel,
"Green, Chroma",
943 (void) PrintChannelPerceptualHash(file,BlueChannel,
"Blue, Luma",
945 if (image->matte != MagickFalse)
946 (void) PrintChannelPerceptualHash(file,AlphaChannel,
"Alpha, Alpha",
953 (void) FormatLocaleFile(file,
" Channel features (horizontal, vertical, "
954 "left and right diagonals, average):\n");
960 (void) PrintChannelFeatures(file,RedChannel,
"Red",channel_features);
961 (void) PrintChannelFeatures(file,GreenChannel,
"Green",
963 (void) PrintChannelFeatures(file,BlueChannel,
"Blue",channel_features);
968 (void) PrintChannelFeatures(file,CyanChannel,
"Cyan",channel_features);
969 (void) PrintChannelFeatures(file,MagentaChannel,
"Magenta",
971 (void) PrintChannelFeatures(file,YellowChannel,
"Yellow",
973 (void) PrintChannelFeatures(file,BlackChannel,
"Black",
977 case LinearGRAYColorspace:
980 (void) PrintChannelFeatures(file,GrayChannel,
"Gray",channel_features);
984 if (image->matte != MagickFalse)
985 (void) PrintChannelFeatures(file,AlphaChannel,
"Alpha",channel_features);
989 if (ping == MagickFalse)
991 if (colorspace == CMYKColorspace)
992 (void) FormatLocaleFile(file,
" Total ink density: %.*g%%\n",
993 GetMagickPrecision(),100.0*GetImageTotalInkDensity(image)/(double)
996 if (image->matte != MagickFalse)
1008 indexes=(IndexPacket *) NULL;
1009 for (y=0; y < (ssize_t) image->rows; y++)
1011 p=GetVirtualPixels(image,0,y,image->columns,1,exception);
1014 indexes=GetVirtualIndexQueue(image);
1015 for (x=0; x < (ssize_t) image->columns; x++)
1017 if (GetPixelOpacity(p) == (Quantum) TransparentOpacity)
1024 if (found != MagickFalse)
1027 if (found != MagickFalse)
1030 tuple[MaxTextExtent];
1035 GetMagickPixelPacket(image,&pixel);
1036 SetMagickPixelPacket(image,p,indexes+x,&pixel);
1037 (void) QueryMagickColorname(image,&pixel,SVGCompliance,tuple,
1039 (void) FormatLocaleFile(file,
" Alpha: %s ",tuple);
1040 GetColorTuple(&pixel,MagickTrue,tuple);
1041 (void) FormatLocaleFile(file,
" %s\n",tuple);
1044 artifact=GetImageArtifact(image,
"identify:unique-colors");
1045 if (IsHistogramImage(image,exception) != MagickFalse)
1047 (void) FormatLocaleFile(file,
" Colors: %.20g\n",(
double)
1048 GetNumberColors(image,(FILE *) NULL,exception));
1049 (void) FormatLocaleFile(file,
" Histogram:\n");
1050 (void) GetNumberColors(image,file,exception);
1053 if ((artifact != (
const char *) NULL) &&
1054 (IsMagickTrue(artifact) != MagickFalse))
1055 (void) FormatLocaleFile(file,
" Colors: %.20g\n",(
double)
1056 GetNumberColors(image,(FILE *) NULL,exception));
1058 if (image->storage_class == PseudoClass)
1060 (void) FormatLocaleFile(file,
" Colormap entries: %.20g\n",(
double)
1062 (void) FormatLocaleFile(file,
" Colormap:\n");
1063 if (image->colors <= 1024)
1066 color[MaxTextExtent],
1068 tuple[MaxTextExtent];
1076 GetMagickPixelPacket(image,&pixel);
1078 for (i=0; i < (ssize_t) image->colors; i++)
1080 SetMagickPixelPacket(image,p,(IndexPacket *) NULL,&pixel);
1081 (void) CopyMagickString(tuple,
"(",MaxTextExtent);
1082 ConcatenateColorComponent(&pixel,RedChannel,X11Compliance,tuple);
1083 (void) ConcatenateMagickString(tuple,
",",MaxTextExtent);
1084 ConcatenateColorComponent(&pixel,GreenChannel,X11Compliance,tuple);
1085 (void) ConcatenateMagickString(tuple,
",",MaxTextExtent);
1086 ConcatenateColorComponent(&pixel,BlueChannel,X11Compliance,tuple);
1087 if (pixel.colorspace == CMYKColorspace)
1089 (void) ConcatenateMagickString(tuple,
",",MaxTextExtent);
1090 ConcatenateColorComponent(&pixel,IndexChannel,X11Compliance,
1093 if (pixel.matte != MagickFalse)
1095 (void) ConcatenateMagickString(tuple,
",",MaxTextExtent);
1096 ConcatenateColorComponent(&pixel,AlphaChannel,X11Compliance,
1099 (void) ConcatenateMagickString(tuple,
")",MaxTextExtent);
1100 (void) QueryMagickColorname(image,&pixel,SVGCompliance,color,
1102 GetColorTuple(&pixel,MagickTrue,hex);
1103 (void) FormatLocaleFile(file,
" %g: %s %s %s\n",(
double) i,tuple,
1109 if (image->error.mean_error_per_pixel != 0.0)
1110 (void) FormatLocaleFile(file,
" Mean error per pixel: %g\n",
1111 image->error.mean_error_per_pixel);
1112 if (image->error.normalized_mean_error != 0.0)
1113 (void) FormatLocaleFile(file,
" Normalized mean error: %g\n",
1114 image->error.normalized_mean_error);
1115 if (image->error.normalized_maximum_error != 0.0)
1116 (void) FormatLocaleFile(file,
" Normalized maximum error: %g\n",
1117 image->error.normalized_maximum_error);
1118 (void) FormatLocaleFile(file,
" Rendering intent: %s\n",
1119 CommandOptionToMnemonic(MagickIntentOptions,(ssize_t)
1120 image->rendering_intent));
1121 if (image->gamma != 0.0)
1122 (void) FormatLocaleFile(file,
" Gamma: %g\n",image->gamma);
1123 if ((image->chromaticity.red_primary.x != 0.0) ||
1124 (image->chromaticity.green_primary.x != 0.0) ||
1125 (image->chromaticity.blue_primary.x != 0.0) ||
1126 (image->chromaticity.white_point.x != 0.0))
1131 (void) FormatLocaleFile(file,
" Chromaticity:\n");
1132 (void) FormatLocaleFile(file,
" red primary: (%g,%g,%g)\n",
1133 image->chromaticity.red_primary.x,image->chromaticity.red_primary.y,
1134 image->chromaticity.red_primary.z);
1135 (void) FormatLocaleFile(file,
" green primary: (%g,%g,%g)\n",
1136 image->chromaticity.green_primary.x,image->chromaticity.green_primary.y,
1137 image->chromaticity.green_primary.z);
1138 (void) FormatLocaleFile(file,
" blue primary: (%g,%g,%g)\n",
1139 image->chromaticity.blue_primary.x,image->chromaticity.blue_primary.y,
1140 image->chromaticity.blue_primary.z);
1141 (void) FormatLocaleFile(file,
" white point: (%g,%g,%g)\n",
1142 image->chromaticity.white_point.x,image->chromaticity.white_point.y,
1143 image->chromaticity.white_point.z);
1145 if ((image->extract_info.width*image->extract_info.height) != 0)
1146 (
void) FormatLocaleFile(file,
" Tile geometry: %.20gx%.20g%+.20g%+.20g\n",
1147 (
double) image->extract_info.width,(
double) image->extract_info.height,
1148 (
double) image->extract_info.x,(
double) image->extract_info.y);
1149 (void) QueryColorname(image,&image->background_color,SVGCompliance,color,
1151 (void) FormatLocaleFile(file,
" Background color: %s\n",color);
1152 (void) QueryColorname(image,&image->border_color,SVGCompliance,color,
1154 (void) FormatLocaleFile(file,
" Border color: %s\n",color);
1155 (void) QueryColorname(image,&image->matte_color,SVGCompliance,color,
1157 (void) FormatLocaleFile(file,
" Matte color: %s\n",color);
1158 (void) QueryColorname(image,&image->transparent_color,SVGCompliance,color,
1160 (void) FormatLocaleFile(file,
" Transparent color: %s\n",color);
1161 (void) FormatLocaleFile(file,
" Interlace: %s\n",CommandOptionToMnemonic(
1162 MagickInterlaceOptions,(ssize_t) image->interlace));
1163 (void) FormatLocaleFile(file,
" Intensity: %s\n",CommandOptionToMnemonic(
1164 MagickPixelIntensityOptions,(ssize_t) image->intensity));
1165 (void) FormatLocaleFile(file,
" Compose: %s\n",CommandOptionToMnemonic(
1166 MagickComposeOptions,(ssize_t) image->compose));
1167 if ((image->page.width != 0) || (image->page.height != 0) ||
1168 (image->page.x != 0) || (image->page.y != 0))
1169 (void) FormatLocaleFile(file,
" Page geometry: %.20gx%.20g%+.20g%+.20g\n",
1170 (
double) image->page.width,(double) image->page.height,(
double)
1171 image->page.x,(double) image->page.y);
1172 if ((image->page.x != 0) || (image->page.y != 0))
1173 (void) FormatLocaleFile(file,
" Origin geometry: %+.20g%+.20g\n",(
double)
1174 image->page.x,(double) image->page.y);
1175 (void) FormatLocaleFile(file,
" Dispose: %s\n",CommandOptionToMnemonic(
1176 MagickDisposeOptions,(ssize_t) image->dispose));
1177 if (image->delay != 0)
1178 (void) FormatLocaleFile(file,
" Delay: %.20gx%.20g\n",(
double) image->delay,
1179 (double) image->ticks_per_second);
1180 if (image->iterations != 1)
1181 (void) FormatLocaleFile(file,
" Iterations: %.20g\n",(
double)
1183 if (image->duration != 0)
1184 (void) FormatLocaleFile(file,
" Duration: %.20g\n",(
double)
1186 if ((image->next != (
Image *) NULL) || (image->previous != (
Image *) NULL))
1187 (void) FormatLocaleFile(file,
" Scene: %.20g of %.20g\n",(
double)
1188 image->scene,(double) GetImageListLength(image));
1190 if (image->scene != 0)
1191 (void) FormatLocaleFile(file,
" Scene: %.20g\n",(
double) image->scene);
1192 (void) FormatLocaleFile(file,
" Compression: %s\n",CommandOptionToMnemonic(
1193 MagickCompressOptions,(ssize_t) image->compression));
1194 if (image->quality != UndefinedCompressionQuality)
1195 (void) FormatLocaleFile(file,
" Quality: %.20g\n",(
double) image->quality);
1196 (void) FormatLocaleFile(file,
" Orientation: %s\n",CommandOptionToMnemonic(
1197 MagickOrientationOptions,(ssize_t) image->orientation));
1198 if (image->montage != (
char *) NULL)
1199 (
void) FormatLocaleFile(file,
" Montage: %s\n",image->montage);
1200 if (image->directory != (
char *) NULL)
1218 image_info=AcquireImageInfo();
1219 (void) CloneString(&image_info->size,
"64x64");
1220 (void) FormatLocaleFile(file,
" Directory:\n");
1221 for (p=image->directory; *p !=
'\0'; p++)
1224 while ((*q !=
'\xff') && (*q !=
'\0') &&
1225 ((
size_t) (q-p+1) <
sizeof(image_info->filename)))
1227 (void) CopyMagickString(image_info->filename,p,(
size_t) (q-p+1));
1229 (void) FormatLocaleFile(file,
" %s",image_info->filename);
1230 handler=SetWarningHandler((WarningHandler) NULL);
1231 tile=StrictReadImage(image_info,exception);
1232 (void) SetWarningHandler(handler);
1233 if (tile == (
Image *) NULL)
1235 (void) FormatLocaleFile(file,
"\n");
1238 (void) FormatLocaleFile(file,
" %.20gx%.20g %s\n",(
double)
1239 tile->magick_columns,(double) tile->magick_rows,tile->magick);
1240 (void) SignatureImage(tile);
1241 ResetImagePropertyIterator(tile);
1242 property=GetNextImageProperty(tile);
1243 while (property != (
const char *) NULL)
1245 (void) FormatLocaleFile(file,
" %s:\n",property);
1246 value=GetImageProperty(tile,property);
1247 if (value != (
const char *) NULL)
1248 (void) FormatLocaleFile(file,
"%s\n",value);
1249 property=GetNextImageProperty(tile);
1251 tile=DestroyImage(tile);
1253 image_info=DestroyImageInfo(image_info);
1255 (void) FormatLocaleString(key,MaxTextExtent,
"8BIM:1999,2998:#1");
1256 value=GetImageProperty(image,key);
1257 if (value != (
const char *) NULL)
1262 (void) FormatLocaleFile(file,
" Clipping path: ");
1263 if (strlen(value) > 80)
1264 (
void) fputc(
'\n',file);
1265 (void) FormatLocaleFile(file,
"%s\n",value);
1267 ResetImageProfileIterator(image);
1268 name=GetNextImageProfile(image);
1269 if (name != (
char *) NULL)
1277 (void) FormatLocaleFile(file,
" Profiles:\n");
1278 while (name != (
char *) NULL)
1280 profile=GetImageProfile(image,name);
1283 (void) FormatLocaleFile(file,
" Profile-%s: %.20g bytes\n",name,
1284 (
double) GetStringInfoLength(profile));
1285 if (LocaleCompare(name,
"iptc") == 0)
1306 profile_length=GetStringInfoLength(profile);
1307 for (i=0; i < (ssize_t) profile_length-5; i+=(ssize_t) length)
1310 sentinel=GetStringInfoDatum(profile)[i++];
1311 if (sentinel != 0x1c)
1313 dataset=GetStringInfoDatum(profile)[i++];
1314 record=GetStringInfoDatum(profile)[i++];
1317 case 5: tag=
"Image Name";
break;
1318 case 7: tag=
"Edit Status";
break;
1319 case 10: tag=
"Priority";
break;
1320 case 15: tag=
"Category";
break;
1321 case 20: tag=
"Supplemental Category";
break;
1322 case 22: tag=
"Fixture Identifier";
break;
1323 case 25: tag=
"Keyword";
break;
1324 case 30: tag=
"Release Date";
break;
1325 case 35: tag=
"Release Time";
break;
1326 case 40: tag=
"Special Instructions";
break;
1327 case 45: tag=
"Reference Service";
break;
1328 case 47: tag=
"Reference Date";
break;
1329 case 50: tag=
"Reference Number";
break;
1330 case 55: tag=
"Created Date";
break;
1331 case 60: tag=
"Created Time";
break;
1332 case 65: tag=
"Originating Program";
break;
1333 case 70: tag=
"Program Version";
break;
1334 case 75: tag=
"Object Cycle";
break;
1335 case 80: tag=
"Byline";
break;
1336 case 85: tag=
"Byline Title";
break;
1337 case 90: tag=
"City";
break;
1338 case 92: tag=
"Sub-Location";
break;
1339 case 95: tag=
"Province State";
break;
1340 case 100: tag=
"Country Code";
break;
1341 case 101: tag=
"Country";
break;
1342 case 103: tag=
"Original Transmission Reference";
break;
1343 case 105: tag=
"Headline";
break;
1344 case 110: tag=
"Credit";
break;
1345 case 115: tag=
"Src";
break;
1346 case 116: tag=
"Copyright String";
break;
1347 case 120: tag=
"Caption";
break;
1348 case 121: tag=
"Local Caption";
break;
1349 case 122: tag=
"Caption Writer";
break;
1350 case 200: tag=
"Custom Field 1";
break;
1351 case 201: tag=
"Custom Field 2";
break;
1352 case 202: tag=
"Custom Field 3";
break;
1353 case 203: tag=
"Custom Field 4";
break;
1354 case 204: tag=
"Custom Field 5";
break;
1355 case 205: tag=
"Custom Field 6";
break;
1356 case 206: tag=
"Custom Field 7";
break;
1357 case 207: tag=
"Custom Field 8";
break;
1358 case 208: tag=
"Custom Field 9";
break;
1359 case 209: tag=
"Custom Field 10";
break;
1360 case 210: tag=
"Custom Field 11";
break;
1361 case 211: tag=
"Custom Field 12";
break;
1362 case 212: tag=
"Custom Field 13";
break;
1363 case 213: tag=
"Custom Field 14";
break;
1364 case 214: tag=
"Custom Field 15";
break;
1365 case 215: tag=
"Custom Field 16";
break;
1366 case 216: tag=
"Custom Field 17";
break;
1367 case 217: tag=
"Custom Field 18";
break;
1368 case 218: tag=
"Custom Field 19";
break;
1369 case 219: tag=
"Custom Field 20";
break;
1370 default: tag=
"unknown";
break;
1372 (void) FormatLocaleFile(file,
" %s[%.20g,%.20g]: ",tag,
1373 (
double) dataset,(double) record);
1374 length=(size_t) (GetStringInfoDatum(profile)[i++] << 8);
1375 length|=GetStringInfoDatum(profile)[i++];
1376 length=MagickMin(length,profile_length-i);
1377 attribute=(
char *) NULL;
1378 if (~length >= (MaxTextExtent-1))
1379 attribute=(
char *) AcquireQuantumMemory(length+
1380 MaxTextExtent,
sizeof(*attribute));
1381 if (attribute != (
char *) NULL)
1383 (void) CopyMagickString(attribute,(
char *)
1384 GetStringInfoDatum(profile)+i,length+1);
1385 attribute_list=StringToList(attribute);
1386 if (attribute_list != (
char **) NULL)
1388 for (j=0; attribute_list[j] != (
char *) NULL; j++)
1390 (void) fputs(attribute_list[j],file);
1391 (void) fputs(
"\n",file);
1392 attribute_list[j]=(
char *) RelinquishMagickMemory(
1395 attribute_list=(
char **) RelinquishMagickMemory(
1398 attribute=DestroyString(attribute);
1402 if (image->debug != MagickFalse)
1403 PrintStringInfo(file,name,profile);
1404 name=GetNextImageProfile(image);
1407 ResetImagePropertyIterator(image);
1408 property=GetNextImageProperty(image);
1409 if (property != (
const char *) NULL)
1414 (void) FormatLocaleFile(file,
" Properties:\n");
1415 while (property != (
const char *) NULL)
1417 (void) FormatLocaleFile(file,
" %s: ",property);
1418 value=GetImageProperty(image,property);
1419 if (value != (
const char *) NULL)
1420 (void) FormatLocaleFile(file,
"%s\n",value);
1421 property=GetNextImageProperty(image);
1424 ResetImageArtifactIterator(image);
1425 artifact=GetNextImageArtifact(image);
1426 if (artifact != (
const char *) NULL)
1431 (void) FormatLocaleFile(file,
" Artifacts:\n");
1432 while (artifact != (
const char *) NULL)
1434 (void) FormatLocaleFile(file,
" %s: ",artifact);
1435 value=GetImageArtifact(image,artifact);
1436 if (value != (
const char *) NULL)
1437 (void) FormatLocaleFile(file,
"%s\n",value);
1438 artifact=GetNextImageArtifact(image);
1441 ResetImageRegistryIterator();
1442 registry=GetNextImageRegistry();
1443 if (registry != (
const char *) NULL)
1448 (void) FormatLocaleFile(file,
" Registry:\n");
1449 while (registry != (
const char *) NULL)
1451 (void) FormatLocaleFile(file,
" %s: ",registry);
1452 value=(
const char *) GetImageRegistry(StringRegistryType,registry,
1454 if (value != (
const char *) NULL)
1455 (
void) FormatLocaleFile(file,
"%s\n",value);
1456 registry=GetNextImageRegistry();
1459 (void) FormatLocaleFile(file,
" Tainted: %s\n",CommandOptionToMnemonic(
1460 MagickBooleanOptions,(ssize_t) image->taint));
1461 (void) FormatMagickSize(image->extent,MagickTrue,format);
1462 (void) FormatLocaleFile(file,
" Filesize: %s\n",format);
1463 (void) FormatMagickSize((MagickSizeType) image->columns*image->rows,
1464 MagickFalse,format);
1465 if (strlen(format) > 1)
1466 format[strlen(format)-1]=
'\0';
1467 (void) FormatLocaleFile(file,
" Number pixels: %s\n",format);
1468 if (elapsed_time > MagickEpsilon)
1470 (void) FormatMagickSize((MagickSizeType) ((double) image->columns*
1471 image->rows/elapsed_time+0.5),MagickFalse,format);
1472 (void) FormatLocaleFile(file,
" Pixels per second: %s\n",format);
1474 if (image->ttl != (time_t) 0)
1477 iso8601[
sizeof(
"9999-99-99T99:99:99Z")];
1485 (void) GetMagickUTCTime(&image->ttl,×tamp);
1486 (void) strftime(iso8601,
sizeof(iso8601),
"%Y-%m-%dT%H:%M:%SZ",×tamp);
1487 seconds=MagickMax((
int)(image->ttl-GetMagickTime()),0);
1491 (void) FormatLocaleFile(file,
" Time-to-live: %g:%02g:%02g:%02g%c %s\n",
1492 ceil((
double) (seconds/(3600*24))),
1493 ceil((
double) ((seconds % (24*3600))/3600)),
1494 ceil((
double) ((seconds % 3600)/60)),
1495 ceil((
double) ((seconds % 3600) % 60)),expired,iso8601);
1497 (void) FormatLocaleFile(file,
" User time: %0.3fu\n",user_time);
1498 (void) FormatLocaleFile(file,
" Elapsed time: %lu:%02lu.%03lu\n",
1499 (
unsigned long) (elapsed_time/60.0),(
unsigned long) ceil(fmod(
1500 elapsed_time,60.0)),(
unsigned long) (1000.0*(elapsed_time-floor(
1502 (void) FormatLocaleFile(file,
" Version: %s\n",GetMagickVersion((
size_t *)
1504 (void) fflush(file);
1505 return(ferror(file) != 0 ? MagickFalse : MagickTrue);