18#ifndef MAGICKCORE_CONSTITUTE_PRIVATE_H
19#define MAGICKCORE_CONSTITUTE_PRIVATE_H
21#if defined(__cplusplus) || defined(c_plusplus)
25#include "MagickCore/constitute.h"
26#include "MagickCore/exception.h"
27#include "MagickCore/log.h"
28#include "MagickCore/utility.h"
30static inline Image *StrictReadImage(
const ImageInfo *image_info,
31 ExceptionInfo *exception)
34 magic[MagickPathExtent];
39 (void) GetPathComponent(image_info->filename,MagickPath,magic);
42 (void) ThrowMagickException(exception, GetMagickModule(), OptionError,
43 "ExplicitCoderNotAllowed",
"`%s'",image_info->filename);
44 return((Image *) NULL);
46 if (stat(image_info->filename,&file_info) != 0)
48 (void) ThrowMagickException(exception,GetMagickModule(),FileOpenError,
49 "UnableToOpenFile",
"`%s'",image_info->filename);
50 return((Image *) NULL);
52 if (S_ISREG(file_info.st_mode) == 0)
54 (void) ThrowMagickException(exception,GetMagickModule(),OptionError,
55 "NotARegularFile",
"`%s'",image_info->filename);
56 return((Image *) NULL);
58 return(ReadImage(image_info,exception));
61#if defined(__cplusplus) || defined(c_plusplus)