43 for (i = 0; i < d->
count; i++) {
59 unsigned int tcount, i;
61 unsigned int ofs, dofs;
65 if (!d || !buf || (buf_size < 6 + 16)) {
67 "ExifMnoteDataApple",
"Short MakerNote");
73 if (ofs > buf_size - 16) {
75 "ExifMnoteDataApple",
"Short MakerNote");
79 if ((buf[ofs + 12] ==
'M') && (buf[ofs + 13] ==
'M')) {
81 }
else if ((buf[ofs + 12] ==
'I') && (buf[ofs + 13] ==
'I')) {
85 "ExifMnoteDataApple",
"Unrecognized byte order");
93 if (buf_size < d->offset + 6 + 16 + tcount * 12 + 4) {
95 "ExifMnoteDataApple",
"Short MakerNote");
115 for (i = 0; i < tcount; i++) {
116 if (ofs + 12 > buf_size) {
118 "ExifMnoteApplet",
"Tag size overflow detected (%u vs size %u)", ofs + 12, buf_size);
127 "ExifMnoteApplet",
"Tag size overflow detected (components %lu vs size %u)", d->
entries[i].
components, buf_size);
131 if ((dsize > 65536) || (dsize > buf_size)) {
142 if (dofs > buf_size) {
144 "ExifMnoteApplet",
"Tag size overflow detected (%u vs size %u)", dofs, buf_size);
153 if (dofs + dsize > buf_size) {
155 "ExifMnoteApplet",
"Tag size overflow detected (%u vs size %u)", dofs + dsize, buf_size);
184 if (!d || d->
order == o) {
188 for (i = 0; i < d->
count; i++) {
211 if (!d || (d->
count <= i)) {
222 if (!d || (d->
count <= i)) {
233 if (!d || (d->
count <= i)) {
244 if (!d || (d->
count <= i)) {
255 if (!val || !d || (d->
count <= i)) {
266 if (e->
size < strlen(
"Apple iOS")+1)
269 return !memcmp((
const char *) e->
data,
"Apple iOS", strlen(
"Apple iOS"));
ExifByteOrder
Which byte order to use.
@ EXIF_BYTE_ORDER_INTEL
Little-endian byte order.
@ EXIF_BYTE_ORDER_MOTOROLA
Big-endian byte order.
Defines the ExifData type and the associated functions.
void exif_log(ExifLog *log, ExifLogCode code, const char *domain, const char *format,...)
@ EXIF_LOG_CODE_CORRUPT_DATA
#define EXIF_LOG_NO_MEMORY(l, d, s)
void exif_mem_free(ExifMem *mem, void *d)
void * exif_mem_alloc(ExifMem *mem, ExifLong ds)
static void exif_mnote_data_apple_set_offset(ExifMnoteData *md, unsigned int o)
int exif_mnote_data_apple_identify(const ExifData *ed, const ExifEntry *e)
static void exif_mnote_data_apple_load(ExifMnoteData *md, const unsigned char *buf, unsigned int buf_size)
static char * exif_mnote_data_apple_get_value(ExifMnoteData *md, unsigned int i, char *val, unsigned int maxlen)
static const char * exif_mnote_data_apple_get_name(ExifMnoteData *md, unsigned int i)
static const char * exif_mnote_data_apple_get_title(ExifMnoteData *md, unsigned int i)
static void exif_mnote_data_apple_free(ExifMnoteData *md)
ExifMnoteData * exif_mnote_data_apple_new(ExifMem *mem)
static unsigned int exif_mnote_data_apple_get_id(ExifMnoteData *md, unsigned int i)
static unsigned int exif_mnote_data_apple_count(ExifMnoteData *md)
static const char * exif_mnote_data_apple_get_description(ExifMnoteData *md, unsigned int i)
static void exif_mnote_data_apple_set_byte_order(ExifMnoteData *md, ExifByteOrder o)
void exif_mnote_data_construct(ExifMnoteData *, ExifMem *mem)
ExifLong exif_get_long(const unsigned char *buf, ExifByteOrder order)
Retrieve an ExifLong value from memory.
ExifShort exif_get_short(const unsigned char *buf, ExifByteOrder order)
Retrieve an ExifShort value from memory.
void exif_array_set_byte_order(ExifFormat f, unsigned char *b, unsigned int n, ExifByteOrder o_orig, ExifByteOrder o_new)
EXIF data manipulation functions and types.
char * mnote_apple_entry_get_value(MnoteAppleEntry *entry, char *v, unsigned int maxlen)
const char * mnote_apple_tag_get_title(MnoteAppleTag t)
const char * mnote_apple_tag_get_description(MnoteAppleTag t)
const char * mnote_apple_tag_get_name(MnoteAppleTag t)
Represents the entire EXIF data found in an image.
Data found in one EXIF tag.
unsigned char * data
Pointer to the raw EXIF data for this entry.
unsigned int size
Number of bytes in the buffer at data.
MnoteAppleEntry * entries
const char *(* get_description)(ExifMnoteData *, unsigned int)
void(* load)(ExifMnoteData *, const unsigned char *, unsigned int)
const char *(* get_name)(ExifMnoteData *, unsigned int)
const char *(* get_title)(ExifMnoteData *, unsigned int)
char *(* get_value)(ExifMnoteData *, unsigned int, char *val, unsigned int maxlen)
unsigned int(* get_id)(ExifMnoteData *, unsigned int)
unsigned int(* count)(ExifMnoteData *)
void(* set_offset)(ExifMnoteData *, unsigned int)
void(* set_byte_order)(ExifMnoteData *, ExifByteOrder)
void(* free)(ExifMnoteData *)
ExifMnoteDataMethods methods