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/magick.h"
29#include "MagickCore/magick-private.h"
30#include "MagickCore/utility.h"
32extern MagickExport Image
33 *ReadImageWithoutPostProcessing(
const ImageInfo *,ExceptionInfo *);
35static inline Image *StrictReadImage(ImageInfo *image_info,
36 ExceptionInfo *exception)
38#define MagickMaxCoderDepth 250
41 magic[MagickPathExtent];
43 if (image_info->coder_depth++ >= MagickMaxCoderDepth)
46 (void) ThrowMagickException(exception,GetMagickModule(),OptionError,
47 "ImageNestedTooDeeply",
"`%s'",image_info->filename);
48 return((Image *) NULL);
50 (void) GetPathComponent(image_info->filename,MagickPath,magic);
53 const MagickInfo *magick_info = GetMagickInfo(magic,exception);
54 if ((magick_info != (
const MagickInfo *) NULL) &&
55 (GetMagickExplicitAllowed(magick_info) != MagickFalse))
56 return(ReadImage(image_info,exception));
59 (void) ThrowMagickException(exception,GetMagickModule(),ImageError,
60 "ExplicitCoderNotAllowed",
"`%s'",image_info->filename);
61 return((Image *) NULL);
64 if (IsPathAccessible(image_info->filename) == MagickFalse)
66 (void) ThrowMagickException(exception,GetMagickModule(),FileOpenError,
67 "UnableToOpenFile",
"`%s'",image_info->filename);
68 return((Image *) NULL);
70 return(ReadImage(image_info,exception));
73#if defined(__cplusplus) || defined(c_plusplus)