94 char v[1024], full[1024];
96 printf (
"Tag 0x%x\n", (
int) e->
tag);
100 printf (
"Full: '%s'\n", full);
102 for (i = strlen(full); i > 0; i--) {
104 memset(v,
'*',
sizeof(v));
108 if ((strlen(v) >= i) || (uniform && strcmp(full, v))) {
109 printf(
"Bad truncation!\n");
110 printf(
"Length %2i: '%s'\n", i, v);
124 static const char user_comment[] =
"ASCII\0\0\0A Long User Comment";
125 static const char xp_comment[] =
"U\0C\0S\0-\0002\0 \0C\0o\0m\0m\0e\0n\0t\0";
126 static const char interop[] =
"R98";
127 static const char subsec[] =
"130 ";
134 fprintf (stderr,
"Error running exif_data_new()\n");
142 fprintf (stderr,
"Error running exif_entry_new()\n");
157 fprintf (stderr,
"Error running exif_entry_new()\n");
172 fprintf (stderr,
"Error running exif_entry_new()\n");
189 fprintf (stderr,
"Out of memory\n");
196 fprintf (stderr,
"Out of memory\n");
201 e->
size =
sizeof(subsec);
206 fprintf (stderr,
"Out of memory\n");
217 fprintf (stderr,
"Out of memory\n");
222 e->
size =
sizeof(user_comment) - 1;
227 fprintf (stderr,
"Out of memory\n");
230 memcpy(e->
data, user_comment, e->
size);
238 fprintf (stderr,
"Out of memory\n");
244 e->
size =
sizeof(xp_comment) - 1;
249 fprintf (stderr,
"Out of memory\n");
252 memcpy(e->
data, xp_comment, e->
size);
260 fprintf (stderr,
"Out of memory\n");
267 e->
size =
sizeof(interop);
272 fprintf (stderr,
"Out of memory\n");
283 fprintf (stderr,
"Out of memory\n");
294 fprintf (stderr,
"Out of memory\n");
308 fprintf (stderr,
"Out of memory\n");
319 fprintf (stderr,
"Out of memory\n");
330 fprintf (stderr,
"Out of memory\n");
341 fprintf (stderr,
"Out of memory\n");
354 fprintf (stderr,
"Out of memory\n");
367 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.
ExifData * exif_data_new(void)
Allocate a new ExifData.
void exif_data_unref(ExifData *data)
ExifByteOrder exif_data_get_byte_order(ExifData *data)
Return the byte order in use by this EXIF structure.
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.
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.
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.
@ EXIF_IFD_INTEROPERABILITY
void exif_mem_unref(ExifMem *mem)
Unrefcount an ExifMem.
ExifMem * exif_mem_new_default(void)
Create a new ExifMem with default values for your convenience.
void * exif_mem_alloc(ExifMem *mem, ExifLong ds)
@ 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.
ExifTag nonuniform_test_tags[]
ExifTag rational_test_tags[]
static void check_entry_trunc(ExifEntry *e, int uniform)
ExifTag trunc_test_tags[]