MagickCore 7.1.0
Convert, Edit, Or Compose Bitmap Images
profile.c File Reference
Include dependency graph for profile.c:

Go to the source code of this file.

Data Structures

struct  _ProfileInfo
 
struct  _CMSExceptionInfo
 

Macros

#define ProfileImageTag   "Profile/Image"
 
#define TYPE_XYZ_8   (COLORSPACE_SH(PT_XYZ)|CHANNELS_SH(3)|BYTES_SH(1))
 
#define ThrowProfileException(severity, tag, context)
 
#define MaxDirectoryStack   16
 
#define EXIF_DELIMITER   "\n"
 
#define EXIF_NUM_FORMATS   12
 
#define TAG_EXIF_OFFSET   0x8769
 
#define TAG_INTEROP_OFFSET   0xa005
 

Typedefs

typedef struct _CMSExceptionInfo CMSExceptionInfo
 

Functions

static MagickBooleanType SetImageProfileInternal (Image *, const char *, const StringInfo *, const MagickBooleanType, ExceptionInfo *)
 
static void WriteTo8BimProfile (Image *, const char *, const StringInfo *)
 
MagickExport MagickBooleanType CloneImageProfiles (Image *image, const Image *clone_image)
 
MagickExport MagickBooleanType DeleteImageProfile (Image *image, const char *name)
 
MagickExport void DestroyImageProfiles (Image *image)
 
MagickExport const StringInfoGetImageProfile (const Image *image, const char *name)
 
MagickExport char * GetNextImageProfile (const Image *image)
 
static MagickBooleanType SetsRGBImageProfile (Image *image, ExceptionInfo *exception)
 
MagickExport MagickBooleanType ProfileImage (Image *image, const char *name, const void *datum, const size_t length, ExceptionInfo *exception)
 
MagickExport StringInfoRemoveImageProfile (Image *image, const char *name)
 
MagickExport void ResetImageProfileIterator (const Image *image)
 
static void * DestroyProfile (void *profile)
 
static const unsigned char * ReadResourceByte (const unsigned char *p, unsigned char *quantum)
 
static const unsigned char * ReadResourceLong (const unsigned char *p, unsigned int *quantum)
 
static const unsigned char * ReadResourceShort (const unsigned char *p, unsigned short *quantum)
 
static void WriteResourceLong (unsigned char *p, const unsigned int quantum)
 
static void GetProfilesFromResourceBlock (Image *image, const StringInfo *resource_block, ExceptionInfo *exception)
 
static void PatchCorruptProfile (const char *name, StringInfo *profile)
 
static MagickBooleanType ValidateXMPProfile (Image *image, const StringInfo *profile, ExceptionInfo *exception)
 
MagickExport MagickBooleanType SetImageProfile (Image *image, const char *name, const StringInfo *profile, ExceptionInfo *exception)
 
static int ReadProfileByte (unsigned char **p, size_t *length)
 
static signed short ReadProfileShort (const EndianType endian, unsigned char *buffer)
 
static signed int ReadProfileLong (const EndianType endian, unsigned char *buffer)
 
static signed int ReadProfileMSBLong (unsigned char **p, size_t *length)
 
static signed short ReadProfileMSBShort (unsigned char **p, size_t *length)
 
static void WriteProfileLong (const EndianType endian, const size_t value, unsigned char *p)
 
static void WriteProfileShort (const EndianType endian, const unsigned short value, unsigned char *p)
 
static MagickBooleanType SyncExifProfile (const Image *image, unsigned char *exif, size_t length)
 
static MagickBooleanType Sync8BimProfile (const Image *image, const StringInfo *profile)
 
MagickPrivate MagickBooleanType SyncImageProfiles (Image *image)
 
static void UpdateClipPath (unsigned char *blob, size_t length, const size_t old_columns, const size_t old_rows, const RectangleInfo *new_geometry)
 
MagickPrivate void Update8BIMClipPath (const Image *image, const size_t old_columns, const size_t old_rows, const RectangleInfo *new_geometry)
 

Macro Definition Documentation

◆ EXIF_DELIMITER

#define EXIF_DELIMITER   "\n"

◆ EXIF_NUM_FORMATS

#define EXIF_NUM_FORMATS   12

◆ MaxDirectoryStack

#define MaxDirectoryStack   16

◆ ProfileImageTag

#define ProfileImageTag   "Profile/Image"

◆ TAG_EXIF_OFFSET

#define TAG_EXIF_OFFSET   0x8769

◆ TAG_INTEROP_OFFSET

#define TAG_INTEROP_OFFSET   0xa005

◆ ThrowProfileException

#define ThrowProfileException (   severity,
  tag,
  context 
)
Value:
{ \
if (profile != (StringInfo *) NULL) \
profile=DestroyStringInfo(profile); \
if (cms_context != (cmsContext) NULL) \
cmsDeleteContext(cms_context); \
if (source_info.profile != (cmsHPROFILE) NULL) \
(void) cmsCloseProfile(source_info.profile); \
if (target_info.profile != (cmsHPROFILE) NULL) \
(void) cmsCloseProfile(target_info.profile); \
ThrowBinaryException(severity,tag,context); \
}
MagickExport StringInfo * DestroyStringInfo(StringInfo *string_info)
Definition: string.c:815

◆ TYPE_XYZ_8

#define TYPE_XYZ_8   (COLORSPACE_SH(PT_XYZ)|CHANNELS_SH(3)|BYTES_SH(1))

Typedef Documentation

◆ CMSExceptionInfo

Function Documentation

◆ CloneImageProfiles()

◆ DeleteImageProfile()

◆ DestroyImageProfiles()

MagickExport void DestroyImageProfiles ( Image image)

Definition at line 229 of file profile.c.

References DestroySplayTree(), and _Image::profiles.

Referenced by CloneImageProfiles(), DestroyImage(), and StripImage().

◆ DestroyProfile()

static void * DestroyProfile ( void *  profile)
static

Definition at line 1560 of file profile.c.

References DestroyStringInfo().

Referenced by SetImageProfileInternal().

◆ GetImageProfile()

◆ GetNextImageProfile()

◆ GetProfilesFromResourceBlock()

◆ PatchCorruptProfile()

static void PatchCorruptProfile ( const char *  name,
StringInfo profile 
)
static

◆ ProfileImage()

MagickExport MagickBooleanType ProfileImage ( Image image,
const char *  name,
const void *  datum,
const size_t  length,
ExceptionInfo exception 
)

◆ ReadProfileByte()

static int ReadProfileByte ( unsigned char **  p,
size_t *  length 
)
inlinestatic

Definition at line 2025 of file profile.c.

Referenced by Sync8BimProfile(), SyncExifProfile(), and Update8BIMClipPath().

◆ ReadProfileLong()

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

Definition at line 2065 of file profile.c.

References LSBEndian.

Referenced by ReadProfileMSBLong(), and SyncExifProfile().

◆ ReadProfileMSBLong()

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

Definition at line 2097 of file profile.c.

References MSBEndian, and ReadProfileLong().

Referenced by Sync8BimProfile(), Update8BIMClipPath(), and UpdateClipPath().

◆ ReadProfileMSBShort()

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

Definition at line 2110 of file profile.c.

References MSBEndian, and ReadProfileShort().

Referenced by Sync8BimProfile(), Update8BIMClipPath(), and UpdateClipPath().

◆ ReadProfileShort()

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

Definition at line 2037 of file profile.c.

References LSBEndian.

Referenced by ReadProfileMSBShort(), and SyncExifProfile().

◆ ReadResourceByte()

static const unsigned char * ReadResourceByte ( const unsigned char *  p,
unsigned char *  quantum 
)
inlinestatic

Definition at line 1565 of file profile.c.

Referenced by GetProfilesFromResourceBlock(), and WriteTo8BimProfile().

◆ ReadResourceLong()

static const unsigned char * ReadResourceLong ( const unsigned char *  p,
unsigned int *  quantum 
)
inlinestatic

Definition at line 1572 of file profile.c.

Referenced by GetProfilesFromResourceBlock(), and WriteTo8BimProfile().

◆ ReadResourceShort()

static const unsigned char * ReadResourceShort ( const unsigned char *  p,
unsigned short *  quantum 
)
inlinestatic

Definition at line 1582 of file profile.c.

Referenced by GetProfilesFromResourceBlock(), and WriteTo8BimProfile().

◆ RemoveImageProfile()

◆ ResetImageProfileIterator()

◆ SetImageProfile()

MagickExport MagickBooleanType SetImageProfile ( Image image,
const char *  name,
const StringInfo profile,
ExceptionInfo exception 
)

Definition at line 1995 of file profile.c.

References MagickFalse, and SetImageProfileInternal().

Referenced by ProfileImage(), SetImageProperty(), and SetsRGBImageProfile().

◆ SetImageProfileInternal()

◆ SetsRGBImageProfile()

static MagickBooleanType SetsRGBImageProfile ( Image image,
ExceptionInfo exception 
)
static

◆ Sync8BimProfile()

◆ SyncExifProfile()

◆ SyncImageProfiles()

◆ Update8BIMClipPath()

MagickPrivate void Update8BIMClipPath ( const Image image,
const size_t  old_columns,
const size_t  old_rows,
const RectangleInfo new_geometry 
)

◆ UpdateClipPath()

static void UpdateClipPath ( unsigned char *  blob,
size_t  length,
const size_t  old_columns,
const size_t  old_rows,
const RectangleInfo new_geometry 
)
static

◆ ValidateXMPProfile()

static MagickBooleanType ValidateXMPProfile ( Image image,
const StringInfo profile,
ExceptionInfo exception 
)
static

◆ WriteProfileLong()

static void WriteProfileLong ( const EndianType  endian,
const size_t  value,
unsigned char *  p 
)
inlinestatic

Definition at line 2124 of file profile.c.

References LSBEndian.

Referenced by Sync8BimProfile(), SyncExifProfile(), and UpdateClipPath().

◆ WriteProfileShort()

static void WriteProfileShort ( const EndianType  endian,
const unsigned short  value,
unsigned char *  p 
)
static

Definition at line 2146 of file profile.c.

References LSBEndian.

Referenced by Sync8BimProfile(), and SyncExifProfile().

◆ WriteResourceLong()

static void WriteResourceLong ( unsigned char *  p,
const unsigned int  quantum 
)
inlinestatic

Definition at line 1590 of file profile.c.

Referenced by WriteTo8BimProfile().

◆ WriteTo8BimProfile()