libgphoto2 photo camera library (libgphoto2) API  2.5.8
exif.h
Go to the documentation of this file.
1 
12 #ifndef _gphoto_exif_
13 #define _gphoto_exif_
14 #include <stdio.h>
15 #include <stdlib.h>
16 #include <string.h>
17 #include <time.h>
18 #include <sys/time.h>
19 #include <fcntl.h>
20 
21 
22 /*
23  * Tag data type information.
24  */
25 typedef enum {
26  EXIF_NOTYPE = 0, /* placeholder */
27  EXIF_BYTE = 1, /* 8-bit unsigned integer */
28  EXIF_ASCII = 2, /* 8-bit bytes w/ last byte null */
29  EXIF_SHORT = 3, /* 16-bit unsigned integer */
30  EXIF_LONG = 4, /* 32-bit unsigned integer */
31  EXIF_RATIONAL = 5, /* 64-bit unsigned fraction */
32  EXIF_SBYTE = 6, /* !8-bit signed integer */
33  EXIF_UNDEFINED = 7, /* !8-bit untyped data */
34  EXIF_SSHORT = 8, /* !16-bit signed integer */
35  EXIF_SLONG = 9, /* !32-bit signed integer */
36  EXIF_SRATIONAL = 10, /* !64-bit signed fraction */
37  EXIF_FLOAT = 11, /* !32-bit IEEE floating point */
38  EXIF_DOUBLE = 12 /* !64-bit IEEE floating point */
39 } EXIFDataType;
40 
41 
42 typedef struct exif_parser {
43  unsigned char *header,*data,*ifds[10];
44  int ifdtags[10]; /* How many tags in each ifd */
45  int ifdcnt; /* Number of IFD's, assumed to be < 10 */
46  unsigned int exiflen;
47  int preparsed,endian;
48 } exifparser;
49 
50 typedef struct {
51  int tag; /* Tag ID, see exif_tags.h */
52  EXIFDataType type; /* Tag data type, see exif_tags.h */
53  int size; /* Length of the data, in bytes. */
54  unsigned char *data; /* The data itself, not an offset */
55  int num; /* When type is (s)rational, we */
56  int den; /* store the value here... */
57  int intval;
58 } ExifData;
59 
60 /*
61  * The same as gpi_exif_get_thumbnail but returns
62  * also the thumbnail size
63  */
64 unsigned char *gpi_exif_get_thumbnail_and_size(exifparser *exifdat, long *size);
65 
66 /*
67  * COMMENT ME
68  */
69 int gpi_exif_stat(exifparser *exifdata);
70 
71 /*
72  * Now, all the 'defines'
73  */
74 
75 #define EXIF_InteroperabilityIndex 0x1
76 #define EXIF_InteroperabilityVersion 0x2
77 #define EXIF_RelatedImageFileFormat 0x1000
78 #define EXIF_RelatedImageWidth 0x1001
79 #define EXIF_RelatedImageLength 0x1002
80 
81 #define EXIF_NewSubFileType 0xFE
82 #define EXIF_ImageWidth 0x100
83 #define EXIF_ImageLength 0x101
84 #define EXIF_BitsPerSample 0x102
85 #define EXIF_Compression 0x103
86 #define EXIF_PhotometricInterpretation 0x106
87 #define EXIF_FillOrder 0x10A
88 #define EXIF_DocumentName 0x10D
89 #define EXIF_ImageDescription 0x10E
90 #define EXIF_Make 0x10F
91 #define EXIF_Model 0x110
92 #define EXIF_StripOffsets 0x111
93 #define EXIF_Orientation 0x112
94 #define EXIF_SamplesPerPixel 0x115
95 #define EXIF_RowsPerStrip 0x116
96 #define EXIF_StripByteCounts 0x117
97 #define EXIF_XResolution 0x11A
98 #define EXIF_YResolution 0x11B
99 #define EXIF_PlanarConfiguration 0x11C
100 #define EXIF_ResolutionUnit 0x128
101 #define EXIF_TransferFunction 0x12D
102 #define EXIF_Software 0x131
103 #define EXIF_DateTime 0x132
104 #define EXIF_Artist 0x13B
105 #define EXIF_WhitePoint 0x13E
106 #define EXIF_PrimaryChromaticities 0x13F
107 #define EXIF_TransferRange 0x156
108 #define EXIF_JPEGProc 0x200
109 #define EXIF_JPEGInterchangeFormat 0x201
110 #define EXIF_JPEGInterchangeFormatLength 0x202
111 #define EXIF_YCbCrCoefficients 0x211
112 #define EXIF_YCbCrSubSampling 0x212
113 #define EXIF_YCbCrPositioning 0x213
114 #define EXIF_ReferenceBlackWhite 0x214
115 #define EXIF_CFARepeatPatternDim 0x828D
116 #define EXIF_CFAPattern 0x828E
117 #define EXIF_BatteryLevel 0x828F
118 #define EXIF_Copyright 0x8298
119 #define EXIF_ExposureTime 0x829A
120 #define EXIF_FNumber 0x829D
121 /* Be careful: the next tag's official name is IPTC/NAA but
122  we can't do a define with a "/" */
123 #define EXIF_IPTC_NAA 0x83BB
124 #define EXIF_ExifOffset 0x8769
125 #define EXIF_InterColorProfile 0x8773
126 #define EXIF_ExposureProgram 0x8822
127 #define EXIF_SpectralSensitivity 0x8824
128 #define EXIF_GPSInfo 0x8825
129 #define EXIF_ISOSpeedRatings 0x8827
130 #define EXIF_OECF 0x8828
131 #define EXIF_ExifVersion 0x9000
132 #define EXIF_DateTimeOriginal 0x9003
133 #define EXIF_DateTimeDigitized 0x9004
134 #define EXIF_ComponentsConfiguration 0x9101
135 #define EXIF_CompressedBitsPerPixel 0x9102
136 #define EXIF_ShutterSpeedValue 0x9201
137 #define EXIF_ApertureValue 0x9202
138 #define EXIF_BrightnessValue 0x9203
139 #define EXIF_ExposureBiasValue 0x9204
140 #define EXIF_MaxApertureValue 0x9205
141 #define EXIF_SubjectDistance 0x9206
142 #define EXIF_MeteringMode 0x9207
143 #define EXIF_LightSource 0x9208
144 #define EXIF_Flash 0x9209
145 #define EXIF_FocalLength 0x920A
146 #define EXIF_MakerNote 0x927C
147 #define EXIF_UserComment 0x9286
148 #define EXIF_SubSecTime 0x9290
149 #define EXIF_SubSecTimeOriginal 0x9291
150 #define EXIF_SubSecTimeDigitized 0x9292
151 #define EXIF_FlashPixVersion 0xA000
152 #define EXIF_ColorSpace 0xA001
153 #define EXIF_ExifImageWidth 0xA002
154 #define EXIF_ExifImageLength 0xA003
155 #define EXIF_InteroperabilityOffset 0xA005
156 #define EXIF_FlashEnergy 0xA20B /* 0x920B in TIFF/EP */
157 #define EXIF_SpatialFrequencyResponse 0xA20C /* 0x920C - - */
158 #define EXIF_FocalPlaneXResolution 0xA20E /* 0x920E - - */
159 #define EXIF_FocalPlaneYResolution 0xA20F /* 0x920F - - */
160 #define EXIF_FocalPlaneResolutionUnit 0xA210 /* 0x9210 - - */
161 #define EXIF_SubjectLocation 0xA214 /* 0x9214 - - */
162 #define EXIF_ExposureIndex 0xA215 /* 0x9215 - - */
163 #define EXIF_SensingMethod 0xA217 /* 0x9217 - - */
164 #define EXIF_FileSource 0xA300
165 #define EXIF_SceneType 0xA301
166 
167 #endif /* _gphoto_exif_ */
Definition: exif.h:50
Definition: exif.h:42