%
% The path of the GetPathAttributes method is:
%
-% MagickBooleanType GetPathAttributes(const char *path,
-% struct stat *attributes)
+% MagickBooleanType GetPathAttributes(const char *path,void *attributes)
%
% A description of each parameter follows.
%
%
*/
MagickExport MagickBooleanType GetPathAttributes(const char *path,
- struct stat *attributes)
+ void *attributes)
{
+ MagickBooleanType
+ status;
+
if (path == (const char *) NULL)
- {
+ {
errno=EINVAL;
return(MagickFalse);
}
- ResetMagickMemory(attributes,0,sizeof(*attributes));
- return(stat_utf8(path,attributes) == 0 ? MagickTrue : MagickFalse);
+ (void) ResetMagickMemory(attributes,0,sizeof(stat));
+ status=stat_utf8(path,(struct stat *) attributes) == 0 ? MagickTrue :
+ MagickFalse;
+ return(status);
}
\f
/*
AcquireUniqueFilename(char *),
AcquireUniqueSymbolicLink(const char *,char *),
ExpandFilenames(int *,char ***),
- GetPathAttributes(const char *,struct stat *),
+ GetPathAttributes(const char *,void *),
IsPathAccessible(const char *);
extern MagickExport size_t
/*
Identify transparent colormap index.
*/
- (void) SetImageType(image,PaletteBilevelAlphaType,exception);
+ if ((image->storage_class == DirectClass) || (image->colors > 256))
+ (void) SetImageType(image,PaletteBilevelAlphaType,exception);
for (i=0; i < (ssize_t) image->colors; i++)
if (image->colormap[i].alpha != OpaqueAlpha)
{
opacity=i;
continue;
}
- alpha=(double) TransparentAlpha-(double) image->colormap[i].alpha;
- beta=(double) TransparentAlpha-(double)
- image->colormap[opacity].alpha;
+ alpha=fabs(image->colormap[i].alpha-TransparentAlpha);
+ beta=fabs(image->colormap[opacity].alpha-TransparentAlpha);
if (alpha < beta)
opacity=i;
}
opacity=i;
continue;
}
- alpha=(Quantum) TransparentAlpha-(double)
- image->colormap[i].alpha;
- beta=(Quantum) TransparentAlpha-(double)
- image->colormap[opacity].alpha;
+ alpha=fabs(image->colormap[i].alpha-TransparentAlpha);
+ beta=fabs(image->colormap[opacity].alpha-TransparentAlpha);
if (alpha < beta)
opacity=i;
}