97 char v[1024], full[1024];
99 printf (
"Tag 0x%x\n", (
int) e->
tag);
103 printf (
"Full: '%s'\n", full);
105 for (i = strlen(full); i > 0; i--) {
107 memset(v,
'*',
sizeof(v));
111 if ((strlen(v) >= i) || (uniform && strcmp(full, v))) {
112 printf(
"Bad truncation!\n");
113 printf(
"Length %2i: '%s'\n", i, v);
127 static const char user_comment[] =
"ASCII\0\0\0A Long User Comment";
128 static const char xp_comment[] =
"U\0C\0S\0-\0002\0 \0C\0o\0m\0m\0e\0n\0t\0";
129 static const char interop[] =
"R98";
130 static const char subsec[] =
"130 ";
137 fprintf (stderr,
"Error running exif_data_new()\n");
145 fprintf (stderr,
"Error running exif_entry_new()\n");
160 fprintf (stderr,
"Error running exif_entry_new()\n");
175 fprintf (stderr,
"Error running exif_entry_new()\n");
192 fprintf (stderr,
"Out of memory\n");
199 fprintf (stderr,
"Out of memory\n");
204 e->
size =
sizeof(subsec);
209 fprintf (stderr,
"Out of memory\n");
220 fprintf (stderr,
"Out of memory\n");
225 e->
size =
sizeof(user_comment) - 1;
230 fprintf (stderr,
"Out of memory\n");
233 memcpy(e->
data, user_comment, e->
size);
241 fprintf (stderr,
"Out of memory\n");
247 e->
size =
sizeof(xp_comment) - 1;
252 fprintf (stderr,
"Out of memory\n");
255 memcpy(e->
data, xp_comment, e->
size);
263 fprintf (stderr,
"Out of memory\n");
270 e->
size =
sizeof(interop);
275 fprintf (stderr,
"Out of memory\n");
286 fprintf (stderr,
"Out of memory\n");
292 assert(e->
size == 4);
305 fprintf (stderr,
"Out of memory\n");
311 assert(e->
size == 1);
321 fprintf (stderr,
"Out of memory\n");
339 fprintf (stderr,
"Out of memory\n");
352 fprintf (stderr,
"Out of memory\n");
void exif_content_remove_entry(ExifContent *c, ExifEntry *e)
Remove an EXIF tag from an IFD.
void exif_content_add_entry(ExifContent *c, ExifEntry *entry)
Add an EXIF tag to an IFD.
void exif_data_unref(ExifData *data)
ExifByteOrder exif_data_get_byte_order(ExifData *data)
Return the byte order in use by this EXIF structure.
ExifData * exif_data_new(void)
Allocate a new ExifData.
Defines the ExifData type and the associated functions.
ExifEntry * exif_entry_new_mem(ExifMem *mem)
Reserve memory for and initialize new ExifEntry using the specified memory allocator.
const char * exif_entry_get_value(ExifEntry *e, char *val, unsigned int maxlen)
Return a localized textual representation of the value of the EXIF entry.
ExifEntry * exif_entry_new(void)
Reserve memory for and initialize a new ExifEntry.
void exif_entry_unref(ExifEntry *e)
Decrease reference counter for ExifEntry.
void exif_entry_fix(ExifEntry *e)
Fix the type or format of the given EXIF entry to bring it into spec.
void exif_entry_initialize(ExifEntry *e, ExifTag tag)
Initialize an empty ExifEntry with default data in the correct format for the given tag.
@ EXIF_IFD_INTEROPERABILITY
void exif_mem_unref(ExifMem *mem)
Unrefcount an ExifMem.
void * exif_mem_alloc(ExifMem *mem, ExifLong ds)
ExifMem * exif_mem_new_default(void)
Create a new ExifMem with default values for your convenience.
@ EXIF_TAG_SUBJECT_LOCATION
@ EXIF_TAG_INTEROPERABILITY_VERSION
@ EXIF_TAG_MAX_APERTURE_VALUE
@ EXIF_TAG_PLANAR_CONFIGURATION
@ EXIF_TAG_RESOLUTION_UNIT
@ EXIF_TAG_BITS_PER_SAMPLE
@ EXIF_TAG_SUBJECT_DISTANCE
@ EXIF_TAG_APERTURE_VALUE
@ EXIF_TAG_IMAGE_DESCRIPTION
@ EXIF_TAG_FLASH_PIX_VERSION
@ EXIF_TAG_COMPONENTS_CONFIGURATION
@ EXIF_TAG_SHUTTER_SPEED_VALUE
@ EXIF_TAG_PIXEL_X_DIMENSION
@ EXIF_TAG_YCBCR_SUB_SAMPLING
@ EXIF_TAG_SAMPLES_PER_PIXEL
@ EXIF_TAG_EXPOSURE_BIAS_VALUE
@ EXIF_TAG_REFERENCE_BLACK_WHITE
@ EXIF_TAG_BRIGHTNESS_VALUE
#define EXIF_TAG_GPS_TIME_STAMP
#define EXIF_TAG_GPS_VERSION_ID
#define EXIF_TAG_GPS_ALTITUDE_REF
void exif_set_rational(unsigned char *buf, ExifByteOrder order, ExifRational value)
Store an ExifRational value into memory in EXIF format.
void exif_set_srational(unsigned char *buf, ExifByteOrder order, ExifSRational value)
Store an ExifSRational value into memory in EXIF format.
void exif_set_short(unsigned char *b, ExifByteOrder order, ExifShort value)
Store an ExifShort value into memory in EXIF format.
EXIF data manipulation functions and types.
EXIF Unsigned Rational data type.
EXIF Signed Rational data type.
Represents the entire EXIF data found in an image.
ExifContent * ifd[EXIF_IFD_COUNT]
Data for each IFD.
Data found in one EXIF tag.
unsigned long components
Number of elements in the array, if this is an array entry.
ExifFormat format
Type of data in this entry.
unsigned char * data
Pointer to the raw EXIF data for this entry.
ExifTag tag
EXIF tag for this entry.
unsigned int size
Number of bytes in the buffer at data.
static const ExifTag rational_test_tags[]
static void check_entry_trunc(ExifEntry *e, int uniform)
static const ExifTag nonuniform_test_tags[]
static const ExifTag trunc_test_tags[]