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