34 #ifndef __TINYEXIF_H__
35 #define __TINYEXIF_H__
40 #define TINYEXIF_MAJOR_VERSION 1
41 #define TINYEXIF_MINOR_VERSION 0
42 #define TINYEXIF_PATCH_VERSION 1
45 # ifdef TINYEXIF_EXPORT
46 # define TINYEXIF_LIB __declspec(dllexport)
47 # elif defined(TINYEXIF_IMPORT)
48 # define TINYEXIF_LIB __declspec(dllimport)
53 # define TINYEXIF_LIB __attribute__((visibility("default")))
62 PARSE_INVALID_JPEG = 1,
63 PARSE_UNKNOWN_BYTEALIGN = 2,
64 PARSE_ABSENT_DATA = 3,
65 PARSE_CORRUPT_DATA = 4,
70 FIELD_EXIF = (1 << 0),
72 FIELD_ALL = FIELD_EXIF|FIELD_XMP
85 virtual bool IsValid()
const = 0;
89 virtual const uint8_t* GetBuffer(
unsigned desiredLength) = 0;
93 virtual bool SkipBuffer(
unsigned desiredLength) = 0;
103 EXIFInfo(
const uint8_t* data,
unsigned length);
113 int parseFrom(
const uint8_t* data,
unsigned length);
118 int parseFromEXIFSegment(
const uint8_t* buf,
unsigned len);
123 int parseFromXMPSegment(
const uint8_t* buf,
unsigned len);
124 int parseFromXMPSegmentXML(
const char* szXML,
unsigned len);
132 void parseIFDImage(
EntryParser&,
unsigned&,
unsigned&);
144 uint32_t ImageHeight;
145 uint32_t RelatedImageWidth;
146 uint32_t RelatedImageHeight;
147 std::string ImageDescription;
150 std::string SerialNumber;
151 uint16_t Orientation;
160 uint16_t ResolutionUnit;
164 uint16_t BitsPerSample;
165 std::string Software;
166 std::string DateTime;
167 std::string DateTimeOriginal;
168 std::string DateTimeDigitized;
169 std::string SubSecTimeOriginal;
170 std::string Copyright;
173 uint16_t ExposureProgram;
183 uint16_t ISOSpeedRatings;
184 double ShutterSpeedValue;
185 double ApertureValue;
186 double BrightnessValue;
187 double ExposureBiasValue;
188 double SubjectDistance;
207 uint16_t MeteringMode;
215 uint16_t LightSource;
236 uint16_t ProjectionType;
240 std::vector<uint16_t> SubjectArea;
247 double OpticalCenterX;
248 double OpticalCenterY;
253 double FocalLengthMin;
254 double FocalLengthMax;
255 double DigitalZoomRatio;
256 double FocalLengthIn35mm;
257 double FocalPlaneXResolution;
258 double FocalPlaneYResolution;
259 uint16_t FocalPlaneResolutionUnit;
272 double RelativeAltitude;
282 uint16_t GPSDifferential;
285 std::string GPSMapDatum;
286 std::string GPSTimeStamp;
287 std::string GPSDateStamp;
293 } LatComponents, LonComponents;
295 bool hasLatLon()
const;
296 bool hasAltitude()
const;
297 bool hasRelativeAltitude()
const;
298 bool hasOrientation()
const;
299 bool hasSpeed()
const;
305 #endif // __TINYEXIF_H__