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