if (channel == AlphaChannel)
{
status=fprintf(file,StatisticsFormat,name,ClampToQuantum(scale*
- (QuantumRange-channel_statistics[channel].minima)),
+ (QuantumRange-channel_statistics[channel].maxima)),
+ (QuantumRange-channel_statistics[channel].maxima)/(double) QuantumRange,
+ ClampToQuantum(scale*(QuantumRange-channel_statistics[channel].minima)),
(QuantumRange-channel_statistics[channel].minima)/(double) QuantumRange,
- ClampToQuantum(scale*(QuantumRange-channel_statistics[channel].maxima)),
- (QuantumRange-channel_statistics[channel].maxima)/(double) QuantumRange, scale*(QuantumRange-channel_statistics[channel].mean),
- (QuantumRange-channel_statistics[channel].mean)/(double) QuantumRange,
- scale*channel_statistics[channel].standard_deviation,
+ scale*(QuantumRange-channel_statistics[channel].mean),(QuantumRange-
+ channel_statistics[channel].mean)/(double) QuantumRange,scale*
+ channel_statistics[channel].standard_deviation,
channel_statistics[channel].standard_deviation/(double) QuantumRange,
channel_statistics[channel].kurtosis,
channel_statistics[channel].skewness);
ImageType
type;
- long
- y;
-
MagickBooleanType
ping;
- register long
+ register ssize_t
i,
x;
- unsigned long
+ size_t
distance,
scale;
+ ssize_t
+ y;
+
assert(image != (Image *) NULL);
assert(image->signature == MagickSignature);
if (image->debug != MagickFalse)
(image->scene == 0))
(void) fprintf(file,"%s ",image->filename);
else
- (void) fprintf(file,"%s[%lu] ",image->filename,image->scene);
+ (void) fprintf(file,"%s[%.20g] ",image->filename,(double) image->scene);
(void) fprintf(file,"%s ",image->magick);
if ((image->magick_columns != 0) || (image->magick_rows != 0))
if ((image->magick_columns != image->columns) ||
(image->magick_rows != image->rows))
- (void) fprintf(file,"%lux%lu=>",image->magick_columns,
- image->magick_rows);
- (void) fprintf(file,"%lux%lu ",image->columns,image->rows);
+ (void) fprintf(file,"%.20gx%.20g=>",(double) image->magick_columns,
+ (double) image->magick_rows);
+ (void) fprintf(file,"%.20gx%.20g ",(double) image->columns,(double)
+ image->rows);
if ((image->page.width != 0) || (image->page.height != 0) ||
(image->page.x != 0) || (image->page.y != 0))
- (void) fprintf(file,"%lux%lu%+ld%+ld ",image->page.width,
- image->page.height,image->page.x,image->page.y);
- (void) fprintf(file,"%lu-bit ",image->depth);
+ (void) fprintf(file,"%.20gx%.20g%+.20g%+.20g ",(double)
+ image->page.width,(double) image->page.height,(double) image->page.x,
+ (double) image->page.y);
+ (void) fprintf(file,"%.20g-bit ",(double) image->depth);
if (image->type != UndefinedType)
- (void) fprintf(file,"%s ",MagickOptionToMnemonic(MagickTypeOptions,
- (long) image->type));
+ (void) fprintf(file,"%s ",CommandOptionToMnemonic(MagickTypeOptions,
+ (ssize_t) image->type));
if (image->storage_class == DirectClass)
{
(void) fprintf(file,"DirectClass ");
}
else
if (image->total_colors <= image->colors)
- (void) fprintf(file,"PseudoClass %luc ",image->colors);
+ (void) fprintf(file,"PseudoClass %.20gc ",(double) image->colors);
else
- (void) fprintf(file,"PseudoClass %lu=>%luc ",image->total_colors,
- image->colors);
+ (void) fprintf(file,"PseudoClass %.20g=>%.20gc ",(double)
+ image->total_colors,(double) image->colors);
if (image->error.mean_error_per_pixel != 0.0)
- (void) fprintf(file,"%ld/%f/%fdb ",(long)
+ (void) fprintf(file,"%.20g/%f/%fdb ",(double)
(image->error.mean_error_per_pixel+0.5),
image->error.normalized_mean_error,
image->error.normalized_maximum_error);
if (GetBlobSize(image) != 0)
{
(void) FormatMagickSize(GetBlobSize(image),MagickFalse,format);
- (void) fprintf(file,"%sB ",format);
+ (void) fprintf(file,"%s ",format);
}
- (void) fprintf(file,"%0.3fu %ld:%02ld.%03ld",user_time,(long)
- (elapsed_time/60.0),(long) floor(fmod(elapsed_time,60.0)),
- (long) (1000.0*(elapsed_time-floor(elapsed_time))));
+ (void) fprintf(file,"%0.3fu %lu:%02lu.%03lu",user_time,(unsigned long)
+ (elapsed_time/60.0),(unsigned long) floor(fmod(elapsed_time,60.0)),
+ (unsigned long) (1000.0*(elapsed_time-floor(elapsed_time))));
(void) fprintf(file,"\n");
(void) fflush(file);
return(ferror(file) != 0 ? MagickFalse : MagickTrue);
else
(void) fprintf(file," Format: %s (%s)\n",image->magick,
GetMagickDescription(magick_info));
- (void) fprintf(file," Class: %s\n",MagickOptionToMnemonic(MagickClassOptions,
- (long) image->storage_class));
- (void) fprintf(file," Geometry: %lux%lu%+ld%+ld\n",image->columns,
- image->rows,image->tile_offset.x,image->tile_offset.y);
+ (void) fprintf(file," Class: %s\n",CommandOptionToMnemonic(MagickClassOptions,
+ (ssize_t) image->storage_class));
+ (void) fprintf(file," Geometry: %.20gx%.20g%+.20g%+.20g\n",(double)
+ image->columns,(double) image->rows,(double) image->tile_offset.x,(double)
+ image->tile_offset.y);
if ((image->magick_columns != 0) || (image->magick_rows != 0))
if ((image->magick_columns != image->columns) ||
(image->magick_rows != image->rows))
- (void) fprintf(file," Base geometry: %lux%lu\n",image->magick_columns,
- image->magick_rows);
+ (void) fprintf(file," Base geometry: %.20gx%.20g\n",(double)
+ image->magick_columns,(double) image->magick_rows);
if ((image->x_resolution != 0.0) && (image->y_resolution != 0.0))
{
(void) fprintf(file," Resolution: %gx%g\n",image->x_resolution,
(void) fprintf(file," Print size: %gx%g\n",(double) image->columns/
image->x_resolution,(double) image->rows/image->y_resolution);
}
- (void) fprintf(file," Units: %s\n",MagickOptionToMnemonic(
- MagickResolutionOptions,(long) image->units));
- (void) fprintf(file," Type: %s\n",MagickOptionToMnemonic(MagickTypeOptions,
- (long) type));
+ (void) fprintf(file," Units: %s\n",CommandOptionToMnemonic(
+ MagickResolutionOptions,(ssize_t) image->units));
+ (void) fprintf(file," Type: %s\n",CommandOptionToMnemonic(MagickTypeOptions,
+ (ssize_t) type));
if (image->type != UndefinedType)
- (void) fprintf(file," Base type: %s\n",MagickOptionToMnemonic(
- MagickTypeOptions,(long) image->type));
- (void) fprintf(file," Endianess: %s\n",MagickOptionToMnemonic(
- MagickEndianOptions,(long) image->endian));
+ (void) fprintf(file," Base type: %s\n",CommandOptionToMnemonic(
+ MagickTypeOptions,(ssize_t) image->type));
+ (void) fprintf(file," Endianess: %s\n",CommandOptionToMnemonic(
+ MagickEndianOptions,(ssize_t) image->endian));
/*
Detail channel depth and extrema.
*/
- (void) fprintf(file," Colorspace: %s\n",MagickOptionToMnemonic(
- MagickColorspaceOptions,(long) image->colorspace));
+ (void) fprintf(file," Colorspace: %s\n",CommandOptionToMnemonic(
+ MagickColorspaceOptions,(ssize_t) image->colorspace));
channel_statistics=(ChannelStatistics *) NULL;
channel_features=(ChannelFeatures *) NULL;
colorspace=image->colorspace;
if (ping == MagickFalse)
{
- unsigned long
+ size_t
depth;
channel_statistics=GetImageChannelStatistics(image,&image->exception);
}
depth=GetImageDepth(image,&image->exception);
if (image->depth == depth)
- (void) fprintf(file," Depth: %lu-bit\n",image->depth);
+ (void) fprintf(file," Depth: %.20g-bit\n",(double) image->depth);
else
- (void) fprintf(file," Depth: %lu/%lu-bit\n",image->depth,depth);
+ (void) fprintf(file," Depth: %.20g/%.20g-bit\n",(double)
+ image->depth,(double) depth);
(void) fprintf(file," Channel depth:\n");
if (IsGrayImage(image,&image->exception) != MagickFalse)
colorspace=GRAYColorspace;
case RGBColorspace:
default:
{
- (void) fprintf(file," red: %lu-bit\n",
+ (void) fprintf(file," red: %.20g-bit\n",(double)
channel_statistics[RedChannel].depth);
- (void) fprintf(file," green: %lu-bit\n",
+ (void) fprintf(file," green: %.20g-bit\n",(double)
channel_statistics[GreenChannel].depth);
- (void) fprintf(file," blue: %lu-bit\n",
+ (void) fprintf(file," blue: %.20g-bit\n",(double)
channel_statistics[BlueChannel].depth);
- if (image->matte != MagickFalse)
- (void) fprintf(file," alpha: %lu-bit\n",
- channel_statistics[OpacityChannel].depth);
break;
}
case CMYKColorspace:
{
- (void) fprintf(file," cyan: %lu-bit\n",
+ (void) fprintf(file," cyan: %.20g-bit\n",(double)
channel_statistics[CyanChannel].depth);
- (void) fprintf(file," magenta: %lu-bit\n",
+ (void) fprintf(file," magenta: %.20g-bit\n",(double)
channel_statistics[MagentaChannel].depth);
- (void) fprintf(file," yellow: %lu-bit\n",
+ (void) fprintf(file," yellow: %.20g-bit\n",(double)
channel_statistics[YellowChannel].depth);
- (void) fprintf(file," black: %lu-bit\n",
+ (void) fprintf(file," black: %.20g-bit\n",(double)
channel_statistics[BlackChannel].depth);
- if (image->matte != MagickFalse)
- (void) fprintf(file," alpha: %lu-bit\n",
- channel_statistics[OpacityChannel].depth);
break;
}
case GRAYColorspace:
{
- (void) fprintf(file," gray: %lu-bit\n",
+ (void) fprintf(file," gray: %.20g-bit\n",(double)
channel_statistics[GrayChannel].depth);
- if (image->matte != MagickFalse)
- (void) fprintf(file," alpha: %lu-bit\n",
- channel_statistics[OpacityChannel].depth);
break;
}
}
+ if (image->matte != MagickFalse)
+ (void) fprintf(file," alpha: %.20g-bit\n",(double)
+ channel_statistics[OpacityChannel].depth);
scale=1;
if (image->depth <= MAGICKCORE_QUANTUM_DEPTH)
- scale=QuantumRange/((unsigned long) QuantumRange >> ((unsigned long)
+ scale=QuantumRange/((size_t) QuantumRange >> ((size_t)
MAGICKCORE_QUANTUM_DEPTH-image->depth));
}
if (channel_statistics != (ChannelStatistics *) NULL)
if (colorspace != GRAYColorspace)
{
(void) fprintf(file," Image statistics:\n");
- (void) PrintChannelStatistics(file,AllChannels,"Overall",1.0/scale,
+ (void) PrintChannelStatistics(file,CompositeChannels,"Overall",1.0/scale,
channel_statistics);
}
channel_statistics=(ChannelStatistics *) RelinquishMagickMemory(
p=(PixelPacket *) NULL;
indexes=(IndexPacket *) NULL;
- for (y=0; y < (long) image->rows; y++)
+ for (y=0; y < (ssize_t) image->rows; y++)
{
p=GetVirtualPixels(image,0,y,image->columns,1,exception);
if (p == (const PixelPacket *) NULL)
break;
indexes=GetVirtualIndexQueue(image);
- for (x=0; x < (long) image->columns; x++)
+ for (x=0; x < (ssize_t) image->columns; x++)
{
- if (p->opacity == (Quantum) TransparentOpacity)
+ if (GetOpacityPixelComponent(p) == (Quantum) TransparentOpacity)
break;
p++;
}
- if (x < (long) image->columns)
+ if (x < (ssize_t) image->columns)
break;
}
- if ((x < (long) image->columns) || (y < (long) image->rows))
+ if ((x < (ssize_t) image->columns) || (y < (ssize_t) image->rows))
{
char
tuple[MaxTextExtent];
(void) fprintf(file," %s\n",tuple);
}
}
- artifact=GetImageArtifact(image,"identify:unique");
+ artifact=GetImageArtifact(image,"identify:unique-colors");
if ((artifact != (const char *) NULL) &&
(IsMagickTrue(artifact) != MagickFalse))
- (void) fprintf(file," Colors: %lu\n",GetNumberColors(image,
- (FILE *) NULL,&image->exception));
+ (void) fprintf(file," Colors: %.20g\n",(double)
+ GetNumberColors(image,(FILE *) NULL,&image->exception));
if (IsHistogramImage(image,&image->exception) != MagickFalse)
{
(void) fprintf(file," Histogram:\n");
}
if (image->storage_class == PseudoClass)
{
- (void) fprintf(file," Colormap: %lu\n",image->colors);
+ (void) fprintf(file," Colormap: %.20g\n",(double) image->colors);
if (image->colors <= 1024)
{
char
GetMagickPixelPacket(image,&pixel);
p=image->colormap;
- for (i=0; i < (long) image->colors; i++)
+ for (i=0; i < (ssize_t) image->colors; i++)
{
SetMagickPixelPacket(image,p,(IndexPacket *) NULL,&pixel);
(void) CopyMagickString(tuple,"(",MaxTextExtent);
(void) QueryMagickColorname(image,&pixel,SVGCompliance,color,
&image->exception);
GetColorTuple(&pixel,MagickTrue,hex);
- (void) fprintf(file," %8ld: %s %s %s\n",i,tuple,hex,color);
+ (void) fprintf(file," %8ld: %s %s %s\n",(long) i,tuple,hex,color);
p++;
}
}
if (image->error.normalized_maximum_error != 0.0)
(void) fprintf(file," Normalized maximum error: %g\n",
image->error.normalized_maximum_error);
- (void) fprintf(file," Rendering intent: %s\n",MagickOptionToMnemonic(
- MagickIntentOptions,(long) image->rendering_intent));
+ (void) fprintf(file," Rendering intent: %s\n",CommandOptionToMnemonic(
+ MagickIntentOptions,(ssize_t) image->rendering_intent));
if (image->gamma != 0.0)
(void) fprintf(file," Gamma: %g\n",image->gamma);
if ((image->chromaticity.red_primary.x != 0.0) ||
image->chromaticity.white_point.x,image->chromaticity.white_point.y);
}
if ((image->extract_info.width*image->extract_info.height) != 0)
- (void) fprintf(file," Tile geometry: %lux%lu%+ld%+ld\n",
- image->extract_info.width,image->extract_info.height,
- image->extract_info.x,image->extract_info.y);
- (void) fprintf(file," Interlace: %s\n",MagickOptionToMnemonic(
- MagickInterlaceOptions,(long) image->interlace));
+ (void) fprintf(file," Tile geometry: %.20gx%.20g%+.20g%+.20g\n",(double)
+ image->extract_info.width,(double) image->extract_info.height,(double)
+ image->extract_info.x,(double) image->extract_info.y);
+ (void) fprintf(file," Interlace: %s\n",CommandOptionToMnemonic(
+ MagickInterlaceOptions,(ssize_t) image->interlace));
(void) QueryColorname(image,&image->background_color,SVGCompliance,color,
&image->exception);
(void) fprintf(file," Background color: %s\n",color);
(void) QueryColorname(image,&image->transparent_color,SVGCompliance,color,
&image->exception);
(void) fprintf(file," Transparent color: %s\n",color);
- (void) fprintf(file," Compose: %s\n",MagickOptionToMnemonic(
- MagickComposeOptions,(long) image->compose));
+ (void) fprintf(file," Compose: %s\n",CommandOptionToMnemonic(
+ MagickComposeOptions,(ssize_t) image->compose));
if ((image->page.width != 0) || (image->page.height != 0) ||
(image->page.x != 0) || (image->page.y != 0))
- (void) fprintf(file," Page geometry: %lux%lu%+ld%+ld\n",image->page.width,
- image->page.height,image->page.x,image->page.y);
+ (void) fprintf(file," Page geometry: %.20gx%.20g%+.20g%+.20g\n",(double)
+ image->page.width,(double) image->page.height,(double)
+ image->page.x,(double) image->page.y);
if ((image->page.x != 0) || (image->page.y != 0))
- (void) fprintf(file," Origin geometry: %+ld%+ld\n",image->page.x,
- image->page.y);
- (void) fprintf(file," Dispose: %s\n",MagickOptionToMnemonic(
- MagickDisposeOptions,(long) image->dispose));
+ (void) fprintf(file," Origin geometry: %+.20g%+.20g\n",(double)
+ image->page.x,(double) image->page.y);
+ (void) fprintf(file," Dispose: %s\n",CommandOptionToMnemonic(
+ MagickDisposeOptions,(ssize_t) image->dispose));
if (image->delay != 0)
- (void) fprintf(file," Delay: %lux%ld\n",image->delay,
- image->ticks_per_second);
+ (void) fprintf(file," Delay: %.20gx%.20g\n",(double) image->delay,
+ (double) image->ticks_per_second);
if (image->iterations != 1)
- (void) fprintf(file," Iterations: %lu\n",image->iterations);
+ (void) fprintf(file," Iterations: %.20g\n",(double) image->iterations);
if ((image->next != (Image *) NULL) || (image->previous != (Image *) NULL))
- (void) fprintf(file," Scene: %lu of %lu\n",image->scene,
- GetImageListLength(image));
+ (void) fprintf(file," Scene: %.20g of %.20g\n",(double) image->scene,
+ (double) GetImageListLength(image));
else
if (image->scene != 0)
- (void) fprintf(file," Scene: %lu\n",image->scene);
- (void) fprintf(file," Compression: %s\n",MagickOptionToMnemonic(
- MagickCompressOptions,(long) image->compression));
+ (void) fprintf(file," Scene: %.20g\n",(double) image->scene);
+ (void) fprintf(file," Compression: %s\n",CommandOptionToMnemonic(
+ MagickCompressOptions,(ssize_t) image->compression));
if (image->quality != UndefinedCompressionQuality)
- (void) fprintf(file," Quality: %lu\n",image->quality);
- (void) fprintf(file," Orientation: %s\n",MagickOptionToMnemonic(
- MagickOrientationOptions,(long) image->orientation));
+ (void) fprintf(file," Quality: %.20g\n",(double) image->quality);
+ (void) fprintf(file," Orientation: %s\n",CommandOptionToMnemonic(
+ MagickOrientationOptions,(ssize_t) image->orientation));
if (image->montage != (char *) NULL)
(void) fprintf(file," Montage: %s\n",image->montage);
if (image->directory != (char *) NULL)
(void) fprintf(file,"\n");
continue;
}
- (void) fprintf(file," %lux%lu %s\n",tile->magick_columns,
- tile->magick_rows,tile->magick);
+ (void) fprintf(file," %.20gx%.20g %s\n",(double) tile->magick_columns,
+ (double) tile->magick_rows,tile->magick);
(void) SignatureImage(tile);
ResetImagePropertyIterator(tile);
property=GetNextImageProperty(tile);
(void) fprintf(file," Properties:\n");
while (property != (const char *) NULL)
{
- (void) fprintf(file," %c",*property);
- if (strlen(property) > 1)
- (void) fprintf(file,"%s: ",property+1);
- if (strlen(property) > 80)
- (void) fputc('\n',file);
+ (void) fprintf(file," %s: ",property);
value=GetImageProperty(image,property);
if (value != (const char *) NULL)
(void) fprintf(file,"%s\n",value);
profile=GetImageProfile(image,name);
if (profile == (StringInfo *) NULL)
continue;
- (void) fprintf(file," Profile-%s: %lu bytes\n",name,(unsigned long)
+ (void) fprintf(file," Profile-%s: %.20g bytes\n",name,(double)
GetStringInfoLength(profile));
#if defined(MAGICKCORE_LCMS_DELEGATE)
if ((LocaleCompare(name,"icc") == 0) ||
record,
sentinel;
- register long
+ register ssize_t
j;
size_t
profile_length;
profile_length=GetStringInfoLength(profile);
- for (i=0; i < (long) profile_length; i+=(long) length)
+ for (i=0; i < (ssize_t) profile_length; i+=(ssize_t) length)
{
length=1;
sentinel=GetStringInfoDatum(profile)[i++];
case 219: tag="Custom Field 20"; break;
default: tag="unknown"; break;
}
- (void) fprintf(file," %s[%ld,%ld]: ",tag,dataset,record);
+ (void) fprintf(file," %s[%.20g,%.20g]: ",tag,(double)
+ dataset,(double) record);
length=(size_t) (GetStringInfoDatum(profile)[i++] << 8);
length|=GetStringInfoDatum(profile)[i++];
attribute=(char *) NULL;
(void) fprintf(file," Artifacts:\n");
while (artifact != (const char *) NULL)
{
- (void) fprintf(file," %c",*artifact);
- if (strlen(artifact) > 1)
- (void) fprintf(file,"%s: ",artifact+1);
- if (strlen(artifact) > 80)
- (void) fputc('\n',file);
+ (void) fprintf(file," %s: ",artifact);
value=GetImageArtifact(image,artifact);
if (value != (const char *) NULL)
(void) fprintf(file,"%s\n",value);
(void) fprintf(file," Registry:\n");
while (registry != (const char *) NULL)
{
- (void) fprintf(file," %c",*registry);
- if (strlen(registry) > 1)
- (void) fprintf(file,"%s: ",registry+1);
- if (strlen(registry) > 80)
- (void) fputc('\n',file);
+ (void) fprintf(file," %s: ",registry);
value=(const char *) GetImageRegistry(StringRegistryType,registry,
&image->exception);
if (value != (const char *) NULL)
registry=GetNextImageRegistry();
}
}
- (void) fprintf(file," Tainted: %s\n",MagickOptionToMnemonic(
- MagickBooleanOptions,(long) image->taint));
+ (void) fprintf(file," Tainted: %s\n",CommandOptionToMnemonic(
+ MagickBooleanOptions,(ssize_t) image->taint));
(void) FormatMagickSize(GetBlobSize(image),MagickFalse,format);
(void) fprintf(file," Filesize: %sB\n",format);
(void) FormatMagickSize((MagickSizeType) image->columns*image->rows,
elapsed_time+0.5),MagickFalse,format);
(void) fprintf(file," Pixels per second: %s\n",format);
(void) fprintf(file," User time: %0.3fu\n",user_time);
- (void) fprintf(file," Elapsed time: %ld:%02ld.%03ld\n",(long)
- (elapsed_time/60.0),(long) ceil(fmod(elapsed_time,60.0)),(long)
- (1000.0*(elapsed_time-floor(elapsed_time))));
- (void) fprintf(file," Version: %s\n",GetMagickVersion((unsigned long *)
+ (void) fprintf(file," Elapsed time: %lu:%02lu.%03lu\n",(unsigned long)
+ (elapsed_time/60.0),(unsigned long) ceil(fmod(elapsed_time,60.0)),
+ (unsigned long) (1000.0*(elapsed_time-floor(elapsed_time))));
+ (void) fprintf(file," Version: %s\n",GetMagickVersion((size_t *)
NULL));
(void) fflush(file);
return(ferror(file) != 0 ? MagickFalse : MagickTrue);