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
35static inline MagickBooleanType CheckCoderDepth(
ImageInfo *image_info,
38#define MagickMaxCoderDepth 128
40 if (image_info->coder_depth++ >= MagickMaxCoderDepth)
43 (void) ThrowMagickException(exception,GetMagickModule(),OptionError,
44 "ImageNestedTooDeeply",
"`%s'",image_info->filename);
54 magic[MagickPathExtent];
56 if (CheckCoderDepth(image_info,exception) == MagickFalse)
57 return((
Image *) NULL);
58 (void) GetPathComponent(image_info->filename,MagickPath,magic);
61 const MagickInfo *magick_info = GetMagickInfo(magic,exception);
62 if ((magick_info != (
const MagickInfo *) NULL) &&
63 (GetMagickExplicitAllowed(magick_info) != MagickFalse))
64 return(ReadImage(image_info,exception));
67 (void) ThrowMagickException(exception,GetMagickModule(),ImageError,
68 "ExplicitCoderNotAllowed",
"`%s'",image_info->filename);
69 return((
Image *) NULL);
72 if (IsPathAccessible(image_info->filename) == MagickFalse)
74 (void) ThrowMagickException(exception,GetMagickModule(),FileOpenError,
75 "UnableToOpenFile",
"`%s'",image_info->filename);
76 return((
Image *) NULL);
78 return(ReadImage(image_info,exception));
84 if (CheckCoderDepth(image_info,exception) == MagickFalse)
85 return((
Image *) NULL);
86 return(ReadInlineImage(image_info,content,exception));
89#if defined(__cplusplus) || defined(c_plusplus)