MagickCore  6.9.11
property.c File Reference
#include "magick/studio.h"
#include "magick/artifact.h"
#include "magick/attribute.h"
#include "magick/cache.h"
#include "magick/cache-private.h"
#include "magick/color.h"
#include "magick/colorspace-private.h"
#include "magick/compare.h"
#include "magick/constitute.h"
#include "magick/draw.h"
#include "magick/effect.h"
#include "magick/exception.h"
#include "magick/exception-private.h"
#include "magick/fx.h"
#include "magick/fx-private.h"
#include "magick/gem.h"
#include "magick/geometry.h"
#include "magick/histogram.h"
#include "magick/image.h"
#include "magick/layer.h"
#include "magick/list.h"
#include "magick/magick.h"
#include "magick/memory_.h"
#include "magick/monitor.h"
#include "magick/montage.h"
#include "magick/option.h"
#include "magick/policy.h"
#include "magick/profile.h"
#include "magick/property.h"
#include "magick/quantum.h"
#include "magick/resource_.h"
#include "magick/splay-tree.h"
#include "magick/signature-private.h"
#include "magick/statistic.h"
#include "magick/string_.h"
#include "magick/string-private.h"
#include "magick/token.h"
#include "magick/utility.h"
#include "magick/version.h"
#include "magick/xml-tree.h"
Include dependency graph for property.c:

Go to the source code of this file.

Macros

#define MaxDirectoryStack   16
 
#define EXIF_DELIMITER   "\n"
 
#define EXIF_NUM_FORMATS   12
 
#define EXIF_FMT_BYTE   1
 
#define EXIF_FMT_STRING   2
 
#define EXIF_FMT_USHORT   3
 
#define EXIF_FMT_ULONG   4
 
#define EXIF_FMT_URATIONAL   5
 
#define EXIF_FMT_SBYTE   6
 
#define EXIF_FMT_UNDEFINED   7
 
#define EXIF_FMT_SSHORT   8
 
#define EXIF_FMT_SLONG   9
 
#define EXIF_FMT_SRATIONAL   10
 
#define EXIF_FMT_SINGLE   11
 
#define EXIF_FMT_DOUBLE   12
 
#define TAG_EXIF_OFFSET   0x8769
 
#define TAG_GPS_OFFSET   0x8825
 
#define TAG_INTEROP_OFFSET   0xa005
 
#define EXIFMultipleValues(size, format, arg)
 
#define EXIFMultipleFractions(size, format, arg1, arg2)
 
#define WarnNoImageInfoReturn(format, arg)
 
#define ExtendInterpretText(string_length)
 
#define AppendKeyValue2Text(key, value)
 
#define AppendString2Text(string)
 

Functions

MagickExport MagickBooleanType CloneImageProperties (Image *image, const Image *clone_image)
 
MagickExport MagickBooleanType DefineImageProperty (Image *image, const char *property)
 
MagickExport MagickBooleanType DeleteImageProperty (Image *image, const char *property)
 
MagickExport void DestroyImageProperties (Image *image)
 
MagickExport MagickBooleanType FormatImageProperty (Image *image, const char *property, const char *format,...)
 
static char * TracePSClippath (const unsigned char *, size_t, const size_t, const size_t)
 
static char * TraceSVGClippath (const unsigned char *, size_t, const size_t, const size_t)
 
static MagickBooleanType GetIPTCProperty (const Image *image, const char *key)
 
static int ReadPropertyByte (const unsigned char **p, size_t *length)
 
static signed int ReadPropertyMSBLong (const unsigned char **p, size_t *length)
 
static signed short ReadPropertyMSBShort (const unsigned char **p, size_t *length)
 
static MagickBooleanType Get8BIMProperty (const Image *image, const char *key)
 
static signed int ReadPropertySignedLong (const EndianType endian, const unsigned char *buffer)
 
static unsigned int ReadPropertyUnsignedLong (const EndianType endian, const unsigned char *buffer)
 
static signed short ReadPropertySignedShort (const EndianType endian, const unsigned char *buffer)
 
static unsigned short ReadPropertyUnsignedShort (const EndianType endian, const unsigned char *buffer)
 
static MagickBooleanType GetEXIFProperty (const Image *image, const char *property)
 
static MagickBooleanType GetICCProperty (const Image *image, const char *property)
 
static MagickBooleanType SkipXMPValue (const char *value)
 
static MagickBooleanType GetXMPProperty (const Image *image, const char *property)
 
static char * TracePSClippath (const unsigned char *blob, size_t length, const size_t magick_unused(columns), const size_t magick_unused(rows))
 
static void TraceBezierCurve (char *message, PointInfo *last, PointInfo *point)
 
MagickExport const char * GetImageProperty (const Image *image, const char *property)
 
static const char * GetMagickPropertyLetter (const ImageInfo *image_info, Image *image, const char letter)
 
MagickExport const char * GetMagickProperty (const ImageInfo *image_info, Image *image, const char *property)
 
MagickExport char * GetNextImageProperty (const Image *image)
 
MagickExport char * InterpretImageProperties (const ImageInfo *image_info, Image *image, const char *embed_text)
 
MagickExport char * RemoveImageProperty (Image *image, const char *property)
 
MagickExport void ResetImagePropertyIterator (const Image *image)
 
MagickExport MagickBooleanType SetImageProperty (Image *image, const char *property, const char *value)
 

Macro Definition Documentation

#define AppendKeyValue2Text (   key,
  value 
)
Value:
{ \
size_t length=strlen(key)+strlen(value)+2; \
if ((size_t) (q-interpret_text+length+1) >= extent) \
{ \
extent+=length; \
interpret_text=(char *) ResizeQuantumMemory(interpret_text,extent+ \
MaxTextExtent,sizeof(*interpret_text)); \
if (interpret_text == (char *) NULL) \
{ \
if (property_info != image_info) \
property_info=DestroyImageInfo(property_info); \
return((char *) NULL); \
} \
q=interpret_text+strlen(interpret_text); \
} \
q+=FormatLocaleString(q,extent,"%s=%s\n",(key),(value)); \
}
MagickExport ssize_t FormatLocaleString(char *magick_restrict string, const size_t length, const char *magick_restrict format,...)
Definition: locale.c:497
MagickExport void * ResizeQuantumMemory(void *memory, const size_t count, const size_t quantum)
Definition: memory.c:1408
#define MaxTextExtent
MagickExport ImageInfo * DestroyImageInfo(ImageInfo *image_info)
Definition: image.c:1239

Referenced by InterpretImageProperties().

#define AppendString2Text (   string)
Value:
{ \
size_t length=strlen((string)); \
if ((size_t) (q-interpret_text+length+1) >= extent) \
{ \
extent+=length; \
interpret_text=(char *) ResizeQuantumMemory(interpret_text,extent+ \
MaxTextExtent,sizeof(*interpret_text)); \
if (interpret_text == (char *) NULL) \
{ \
if (property_info != image_info) \
property_info=DestroyImageInfo(property_info); \
return((char *) NULL); \
} \
q=interpret_text+strlen(interpret_text); \
} \
(void) CopyMagickString(q,(string),extent); \
q+=length; \
}
MagickExport size_t CopyMagickString(char *magick_restrict destination, const char *magick_restrict source, const size_t length)
Definition: string.c:753
MagickExport void * ResizeQuantumMemory(void *memory, const size_t count, const size_t quantum)
Definition: memory.c:1408
#define MaxTextExtent
MagickExport ImageInfo * DestroyImageInfo(ImageInfo *image_info)
Definition: image.c:1239

Referenced by InterpretImageProperties().

#define EXIF_DELIMITER   "\n"
#define EXIF_FMT_BYTE   1

Referenced by GetEXIFProperty().

#define EXIF_FMT_DOUBLE   12

Referenced by GetEXIFProperty().

#define EXIF_FMT_SBYTE   6

Referenced by GetEXIFProperty().

#define EXIF_FMT_SINGLE   11

Referenced by GetEXIFProperty().

#define EXIF_FMT_SLONG   9

Referenced by GetEXIFProperty().

#define EXIF_FMT_SRATIONAL   10

Referenced by GetEXIFProperty().

#define EXIF_FMT_SSHORT   8

Referenced by GetEXIFProperty().

#define EXIF_FMT_STRING   2

Referenced by GetEXIFProperty().

#define EXIF_FMT_ULONG   4

Referenced by GetEXIFProperty().

#define EXIF_FMT_UNDEFINED   7

Referenced by GetEXIFProperty().

#define EXIF_FMT_URATIONAL   5

Referenced by GetEXIFProperty().

#define EXIF_FMT_USHORT   3

Referenced by GetEXIFProperty().

#define EXIF_NUM_FORMATS   12
#define EXIFMultipleFractions (   size,
  format,
  arg1,
  arg2 
)
Value:
{ \
ssize_t \
component; \
\
size_t \
length; \
\
unsigned char \
*p1; \
\
length=0; \
p1=p; \
for (component=0; component < components; component++) \
{ \
length+=FormatLocaleString(buffer+length,MaxTextExtent-length, \
format", ",(arg1),(arg2)); \
if (length >= (MaxTextExtent-1)) \
length=MaxTextExtent-1; \
p1+=size; \
} \
if (length > 1) \
buffer[length-2]='\0'; \
value=AcquireString(buffer); \
}
MagickExport ssize_t FormatLocaleString(char *magick_restrict string, const size_t length, const char *magick_restrict format,...)
Definition: locale.c:497
MagickExport char * AcquireString(const char *source)
Definition: string.c:125
#define MaxTextExtent

Referenced by GetEXIFProperty().

#define EXIFMultipleValues (   size,
  format,
  arg 
)
Value:
{ \
ssize_t \
component; \
\
size_t \
length; \
\
unsigned char \
*p1; \
\
length=0; \
p1=p; \
for (component=0; component < components; component++) \
{ \
length+=FormatLocaleString(buffer+length,MaxTextExtent-length, \
format", ",arg); \
if (length >= (MaxTextExtent-1)) \
length=MaxTextExtent-1; \
p1+=size; \
} \
if (length > 1) \
buffer[length-2]='\0'; \
value=AcquireString(buffer); \
}
MagickExport ssize_t FormatLocaleString(char *magick_restrict string, const size_t length, const char *magick_restrict format,...)
Definition: locale.c:497
MagickExport char * AcquireString(const char *source)
Definition: string.c:125
#define MaxTextExtent

Referenced by GetEXIFProperty().

#define ExtendInterpretText (   string_length)
Value:
{ \
size_t length=(string_length); \
if ((size_t) (q-interpret_text+length+1) >= extent) \
{ \
extent+=length; \
interpret_text=(char *) ResizeQuantumMemory(interpret_text,extent+ \
MaxTextExtent,sizeof(*interpret_text)); \
if (interpret_text == (char *) NULL) \
{ \
if (property_info != image_info) \
property_info=DestroyImageInfo(property_info); \
return((char *) NULL); \
} \
q=interpret_text+strlen(interpret_text); \
} \
}
MagickExport void * ResizeQuantumMemory(void *memory, const size_t count, const size_t quantum)
Definition: memory.c:1408
#define MaxTextExtent
MagickExport ImageInfo * DestroyImageInfo(ImageInfo *image_info)
Definition: image.c:1239

Referenced by InterpretImageProperties().

#define MaxDirectoryStack   16

Referenced by GetEXIFProperty().

#define TAG_EXIF_OFFSET   0x8769

Referenced by GetEXIFProperty().

#define TAG_GPS_OFFSET   0x8825

Referenced by GetEXIFProperty().

#define TAG_INTEROP_OFFSET   0xa005

Referenced by GetEXIFProperty().

#define WarnNoImageInfoReturn (   format,
  arg 
)
Value:
if (image_info == (ImageInfo *) NULL ) { \
(void) ThrowMagickException(&image->exception,GetMagickModule(), \
OptionWarning,"NoImageInfoForProperty",format,arg); \
return((const char *) NULL); \
}
MagickExport MagickBooleanType ThrowMagickException(ExceptionInfo *exception, const char *module, const char *function, const size_t line, const ExceptionType severity, const char *tag, const char *format,...)
Definition: exception.c:1149
#define GetMagickModule()
Definition: log.h:29

Referenced by GetMagickPropertyLetter().

Function Documentation

MagickExport MagickBooleanType DefineImageProperty ( Image image,
const char *  property 
)

Definition at line 227 of file property.c.

References CopyMagickString(), MaxTextExtent, and SetImageProperty().

MagickExport MagickBooleanType FormatImageProperty ( Image image,
const char *  property,
const char *  format,
  ... 
)

Definition at line 349 of file property.c.

References FormatLocaleStringList(), MaxTextExtent, and SetImageProperty().

Referenced by GetImageChannelDistortion().

static MagickBooleanType GetICCProperty ( const Image image,
const char *  property 
)
static
static MagickBooleanType GetIPTCProperty ( const Image image,
const char *  key 
)
static
MagickExport const char* GetMagickProperty ( const ImageInfo image_info,
Image image,
const char *  property 
)

Definition at line 3018 of file property.c.

References BasePath, _ImageInfo::channel, _Image::colors, _Image::colorspace, _Image::columns, CommandOptionToMnemonic(), _Image::compose, _Image::compression, ConcatenateMagickString(), CopyMagickString(), _Image::depth, _Image::exception, ExtensionPath, _Image::filename, _ImageInfo::filename, FormatLocaleString(), FormatMagickSize(), _Image::gamma, GetBlobSize(), GetImageArtifact(), GetImageBoundingBox(), GetImageChannelEntropy(), GetImageChannelKurtosis(), GetImageChannelMean(), GetImageChannelRange(), GetImageDepth(), GetImageListLength(), GetImageProfile(), GetMagickCopyright(), GetMagickPrecision(), GetMagickPropertyLetter(), GetMagickVersion(), GetNextImageProfile(), GetNumberColors(), GetPathComponent(), GetStringInfoDatum(), GetStringInfoLength(), _ImageInfo::group, HeadPath, _RectangleInfo::height, IdentifyImageType(), _Image::interlace, IsOpaqueImage(), LocaleCompare(), LocaleLower(), _Image::magick, _Image::magick_columns, _Image::magick_filename, _Image::magick_rows, MagickColorspaceOptions, MagickComposeOptions, MagickCompressOptions, MagickFalse, MagickIntentOptions, MagickInterlaceOptions, MagickOrientationOptions, MagickPathExtent, MagickResolutionOptions, MagickTypeOptions, _Image::matte, MaxTextExtent, _ImageInfo::number_scenes, _Image::orientation, _Image::page, PerceptibleReciprocal(), _Image::quality, _Image::rendering_intent, ResetImageProfileIterator(), _Image::rows, _Image::scene, _ImageInfo::scene, SetImageArtifact(), _ImageInfo::unique, _Image::units, _RectangleInfo::width, _RectangleInfo::x, _Image::x_resolution, _RectangleInfo::y, _Image::y_resolution, and _ImageInfo::zero.

Referenced by InterpretImageProperties().

static const char* GetMagickPropertyLetter ( const ImageInfo image_info,
Image image,
const char  letter 
)
static
static int ReadPropertyByte ( const unsigned char **  p,
size_t *  length 
)
inlinestatic

Definition at line 471 of file property.c.

Referenced by Get8BIMProperty(), and GetEXIFProperty().

static signed int ReadPropertyMSBLong ( const unsigned char **  p,
size_t *  length 
)
inlinestatic

Definition at line 483 of file property.c.

Referenced by Get8BIMProperty(), TracePSClippath(), and TraceSVGClippath().

static signed short ReadPropertyMSBShort ( const unsigned char **  p,
size_t *  length 
)
inlinestatic

Definition at line 523 of file property.c.

Referenced by Get8BIMProperty(), TracePSClippath(), and TraceSVGClippath().

static signed int ReadPropertySignedLong ( const EndianType  endian,
const unsigned char *  buffer 
)
inlinestatic

Definition at line 712 of file property.c.

References LSBEndian.

Referenced by GetEXIFProperty().

static signed short ReadPropertySignedShort ( const EndianType  endian,
const unsigned char *  buffer 
)
inlinestatic

Definition at line 765 of file property.c.

References LSBEndian.

Referenced by GetEXIFProperty().

static unsigned int ReadPropertyUnsignedLong ( const EndianType  endian,
const unsigned char *  buffer 
)
inlinestatic

Definition at line 744 of file property.c.

References LSBEndian.

Referenced by GetEXIFProperty().

static unsigned short ReadPropertyUnsignedShort ( const EndianType  endian,
const unsigned char *  buffer 
)
inlinestatic

Definition at line 793 of file property.c.

References LSBEndian.

Referenced by GetEXIFProperty().

MagickExport char* RemoveImageProperty ( Image image,
const char *  property 
)
MagickExport MagickBooleanType SetImageProperty ( Image image,
const char *  property,
const char *  value 
)

Definition at line 4173 of file property.c.

References AcquireImageInfo(), AddValueToSplayTree(), _Image::background_color, _Image::bias, CompareSplayTreeString(), _Image::compose, _Image::compression, ConstantString(), CopyMagickString(), _Image::debug, _Image::delay, DeleteImageProperty(), _Image::depth, DestroyImageInfo(), DestroyString(), DestroyStringInfo(), _Image::dispose, _Image::exception, _Image::filename, _ImageInfo::filename, FileToStringInfo(), _Image::gamma, GetMagickModule, GetPageGeometry(), _Image::gravity, GreaterValue, _Image::intensity, _Image::interpolate, _Image::iterations, LessValue, LocaleCompare(), LogMagickEvent(), _ImageInfo::magick, MagickColorspaceOptions, MagickComposeOptions, MagickCompressOptions, MagickCoreSignature, MagickDisposeOptions, MagickFalse, MagickGravityOptions, MagickIntentOptions, MagickInterpolateOptions, MagickPixelIntensityOptions, MagickResolutionOptions, MagickTrue, MagickTypeOptions, MaxTextExtent, NewSplayTree(), _Image::page, ParseAbsoluteGeometry(), ParseCommandOption(), ParseGeometry(), _Image::properties, QuantumRange, QueryColorDatabase(), RelinquishMagickMemory(), _Image::rendering_intent, _GeometryInfo::rho, RhoValue, SetImageColorspace(), SetImageInfo(), SetImageProfile(), _GeometryInfo::sigma, SigmaValue, _Image::signature, StringToDouble(), StringToDoubleInterval(), StringToUnsignedLong(), _Image::ticks_per_second, _Image::tile_offset, TraceEvent, _Image::type, _Image::units, _Image::x_resolution, and _Image::y_resolution.

Referenced by AutoThresholdImage(), DefineImageProperty(), FormatImageAttribute(), FormatImageAttributeList(), FormatImageProperty(), FormatImagePropertyList(), Get8BIMProperty(), GetEXIFProperty(), GetICCProperty(), GetImageProperty(), GetIPTCProperty(), PreviewImage(), ReadImage(), SetImageAttribute(), SignatureImage(), and ThumbnailImage().

static MagickBooleanType SkipXMPValue ( const char *  value)
static

Definition at line 1745 of file property.c.

References MagickFalse, and MagickTrue.

Referenced by GetXMPProperty().

static void TraceBezierCurve ( char *  message,
PointInfo last,
PointInfo point 
)
inlinestatic

Definition at line 2062 of file property.c.

References FormatLocaleString(), MagickPathExtent, _PointInfo::x, and _PointInfo::y.

Referenced by TraceSVGClippath().

static char* TracePSClippath ( const unsigned char *  ,
size_t  ,
const size_t  ,
const size_t   
)
static

Referenced by Get8BIMProperty().

static char* TracePSClippath ( const unsigned char *  blob,
size_t  length,
const size_t   magick_unusedcolumns,
const size_t   magick_unusedrows 
)
static
static char * TraceSVGClippath ( const unsigned char *  blob,
size_t  length,
const size_t  columns,
const size_t  rows 
)