exif.h 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751
  1. /*
  2. * Copyright (C) 2013 KLab Inc.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. #ifndef EXIF_H_
  17. #define EXIF_H_
  18. #ifdef _WIN32
  19. #define EXIF_API_EXPORT __declspec(dllexport)
  20. #define EXIF_API_CALL
  21. #else
  22. #define EXIF_API_EXPORT /**< API export macro */
  23. #define EXIF_API_CALL /**< API call macro */
  24. #endif
  25. #define EXIF_API_EXPORT_CALL EXIF_API_EXPORT EXIF_API_CALL /**< API export and call macro*/
  26. #ifdef __cplusplus
  27. extern "C" {
  28. #endif
  29. /**
  30. * setVerbose()
  31. *
  32. * Verbose output on/off
  33. *
  34. * parameters
  35. * [in] v : 1=on 0=off
  36. */
  37. void EXIF_API_EXPORT_CALL exif_setVerbose(int);
  38. #ifdef _DEBUG
  39. #ifdef _MSC_VER
  40. #define _CRTDBG_MAP_ALLOC
  41. #include <crtdbg.h>
  42. //#define new ::new(_NORMAL_BLOCK, __FILE__, __LINE__)
  43. #endif
  44. #endif
  45. #include <stdint.h>
  46. /**
  47. * Typical Usage:
  48. *
  49. * The following code describes how to get "Model" Tag's data
  50. * from 0th IFD in "test.jpg".
  51. *
  52. * // Parse the JPEG header and create the pointer array of the IFD tables
  53. * int result;
  54. * void **ifdArray = createIfdTableArray("test.jpg", *result);
  55. * switch (result) {
  56. * case 0:
  57. * :
  58. * }
  59. * if (!ifdArray) {
  60. * return;
  61. * }
  62. *
  63. * // Get the TagNodeInfo that matches the IFD_TYPE & TagId
  64. * TagNodeInfo *tag = getTagInfo(ifdArray, IFD_0TH, TAG_Model);
  65. *
  66. * if (tag) {
  67. * if (!tag->error) {
  68. * printf("Model=[%s]\n", tag->byteData); // TYPE_ASCII
  69. * }
  70. * freeTagInfo(tag);
  71. * }
  72. *
  73. * freeIfdTableArray(ifdArray);
  74. * return;
  75. *
  76. */
  77. // IFD Type
  78. typedef enum {
  79. IFD_UNKNOWN = 0,
  80. IFD_0TH,
  81. IFD_1ST,
  82. IFD_EXIF,
  83. IFD_GPS,
  84. IFD_IO,
  85. IFD_MPF
  86. } EXIF_IFD_TYPE;
  87. // Tag Type
  88. typedef enum {
  89. TYPE_BYTE = 1,
  90. TYPE_ASCII,
  91. TYPE_SHORT,
  92. TYPE_LONG,
  93. TYPE_RATIONAL,
  94. TYPE_SBYTE,
  95. TYPE_UNDEFINED,
  96. TYPE_SSHORT,
  97. TYPE_SLONG,
  98. TYPE_SRATIONAL
  99. } EXIF_IFD_TAG_TYPE;
  100. // Tag info structure
  101. typedef struct _exif_tagNodeInfo ExifTagNodeInfo;
  102. struct _exif_tagNodeInfo {
  103. uint16_t tagId; // tag ID (e.g. TAG_Model = 0x0110)
  104. uint16_t type; // data Type (e.g. TYPE_ASCII = 2)
  105. unsigned int count; // count of the data
  106. unsigned int* numData; // numeric data array
  107. uint8_t* byteData; // byte data array
  108. uint16_t error; // 0: no error 1: parse error
  109. };
  110. typedef struct _exif_image_dir_ent
  111. {
  112. uint32_t ImageFlags;
  113. uint32_t ImageLength;
  114. uint32_t ImageStart;
  115. uint16_t Image1EntryNum;
  116. uint16_t Image2EntryNum;
  117. } EXIF_IMAGE_DIR_ENT;
  118. /**
  119. * Note:
  120. *
  121. * [Type = TYPE_BYTE, TYPE_SHORT, TYPE_LONG,
  122. * TYPE_SBYTE, TYPE_SSHORT, TYPE_SLONG]
  123. * 'numData' holds numeric values.
  124. * numData[0] to numData[count-1] is accessible.
  125. *
  126. * [Type = TYPE_RATIONAL, TYPE_SRATIONAL]
  127. * 'numData' holds numeric values.
  128. * numData[0] to numData[count*2-1] is accessible.
  129. *
  130. * [Type = TYPE_ASCII]
  131. * 'byteData' holds ascii string data.
  132. * 'count' means the whole length of string with '\0' terminator.
  133. *
  134. * [Type = TYPE_UNDEFINED]
  135. * 'byteData' holds byte data.
  136. * byteData[0] to byteData[count-1] is accessible.
  137. *
  138. * If the original tag field holds the wrong value, the 'error' flag
  139. * will be set to 1. In such cases, both 'numData' and 'byteData'
  140. * might have set to NULL. So, the flag should be checked first.
  141. */
  142. // error status
  143. #define EXIF_ERR_READ_FILE -1
  144. #define EXIF_ERR_WRITE_FILE -2
  145. #define EXIF_ERR_INVALID_JPEG -3
  146. #define EXIF_ERR_INVALID_APP1HEADER -4
  147. #define EXIF_ERR_INVALID_IFD -5
  148. #define EXIF_ERR_INVALID_ID -6
  149. #define EXIF_ERR_INVALID_TYPE -7
  150. #define EXIF_ERR_INVALID_COUNT -8
  151. #define EXIF_ERR_INVALID_POINTER -9
  152. #define EXIF_ERR_NOT_EXIST -10
  153. #define EXIF_ERR_ALREADY_EXIST -11
  154. #define EXIF_ERR_UNKNOWN -12
  155. #define EXIF_ERR_MEMALLOC -13
  156. // public funtions
  157. /**
  158. * removeExifSegmentFromJPEGFile()
  159. *
  160. * Remove the Exif segment from a JPEG file
  161. *
  162. * parameters
  163. * [in] inJPEGFileName : original JPEG file
  164. * [in] outJPGEFileName : output JPEG file
  165. *
  166. * return
  167. * 1: OK
  168. * 0: the Exif segment is not found
  169. * -n: error
  170. * ERR_READ_FILE
  171. * ERR_WRITE_FILE
  172. * ERR_INVALID_JPEG
  173. * ERR_INVALID_APP1HEADER
  174. */
  175. int EXIF_API_EXPORT_CALL exif_removeExifSegmentFromJPEGFile(const char* inJPEGFileName,
  176. const char* outJPGEFileName);
  177. /**
  178. * fillIfdTableArray()
  179. *
  180. * Parse the JPEG header and fill in the IFD table
  181. *
  182. * parameters
  183. * [in] JPEGFileName : target JPEG file
  184. * [out] ifdArray[32] : array of IfdTable pointers
  185. *
  186. * return
  187. * n: number of IFD tables
  188. * 0: the Exif segment is not found
  189. * -n: error
  190. * ERR_READ_FILE
  191. * ERR_INVALID_JPEG
  192. * ERR_INVALID_APP1HEADER
  193. * ERR_INVALID_IFD
  194. */
  195. int EXIF_API_EXPORT_CALL exif_fillIfdTableArray(const char* JPEGFileName, void* ifdArray[32]);
  196. /**
  197. * createIfdTableArray()
  198. *
  199. * Parse the JPEG header and create the pointer array of the IFD tables
  200. *
  201. * parameters
  202. * [in] JPEGFileName : target JPEG file
  203. * [out] result : result status value
  204. * n: number of IFD tables
  205. * 0: the Exif segment is not found
  206. * -n: error
  207. * ERR_READ_FILE
  208. * ERR_INVALID_JPEG
  209. * ERR_INVALID_APP1HEADER
  210. * ERR_INVALID_IFD
  211. *
  212. * return
  213. * NULL: error or no Exif segment
  214. * !NULL: pointer array of the IFD tables
  215. */
  216. void EXIF_API_EXPORT ** EXIF_API_CALL exif_createIfdTableArray(const char* JPEGFileName, int* result);
  217. /**
  218. * freeIfdTables()
  219. *
  220. * Free the pointer array of the IFD tables
  221. *
  222. * parameters
  223. * [in] ifdArray : address of the IFD array
  224. */
  225. void EXIF_API_EXPORT_CALL exif_freeIfdTables(void* ifdArray[32]);
  226. /**
  227. * freeIfdTableArray()
  228. *
  229. * Free the pointer array of the IFD tables
  230. *
  231. * parameters
  232. * [in] ifdArray : address of the IFD array
  233. */
  234. void EXIF_API_EXPORT_CALL exif_freeIfdTableArray(void** ifdArray);
  235. /**
  236. * getIfdType()
  237. *
  238. * Returns the type of the IFD
  239. *
  240. * parameters
  241. * [in] ifd: target IFD
  242. *
  243. * return
  244. * IFD TYPE value
  245. */
  246. EXIF_IFD_TYPE EXIF_API_EXPORT_CALL exif_getIfdType(void* ifd);
  247. /**
  248. * dumpIfdTable()
  249. *
  250. * Dump the IFD table
  251. *
  252. * parameters
  253. * [in] ifd: target IFD
  254. */
  255. void EXIF_API_EXPORT_CALL exif_dumpIfdTable(void* ifd);
  256. /**
  257. * dumpIfdTableArray()
  258. *
  259. * Dump the array of the IFD tables
  260. *
  261. * parameters
  262. * [in] ifdArray : address of the IFD array
  263. */
  264. void EXIF_API_EXPORT_CALL exif_dumpIfdTableArray(void** ifdArray);
  265. /**
  266. * getTagInfo()
  267. *
  268. * Get the TagNodeInfo that matches the IFD_TYPE & TagId
  269. *
  270. * parameters
  271. * [in] ifdArray : address of the IFD array
  272. * [in] ifdType : target IFD TYPE
  273. * [in] tagId : target tag ID
  274. *
  275. * return
  276. * NULL: tag is not found
  277. * !NULL: address of the TagNodeInfo structure
  278. */
  279. ExifTagNodeInfo EXIF_API_EXPORT * EXIF_API_CALL exif_getTagInfo(void** ifdArray,
  280. EXIF_IFD_TYPE ifdType,
  281. uint16_t tagId);
  282. /**
  283. * getTagInfoFromIfd()
  284. *
  285. * Get the TagNodeInfo that matches the TagId
  286. *
  287. * parameters
  288. * [in] ifd : target IFD
  289. * [in] tagId : target tag ID
  290. *
  291. * return
  292. * NULL: tag is not found
  293. * !NULL: address of the TagNodeInfo structure
  294. */
  295. ExifTagNodeInfo EXIF_API_EXPORT * EXIF_API_CALL exif_getTagInfoFromIfd(void* ifd, uint16_t tagId);
  296. /**
  297. * freeTagInfo()
  298. *
  299. * Free the TagNodeInfo allocated by getTagInfo() or getTagInfoFromIfd()
  300. *
  301. * parameters
  302. * [in] tag : target TagNodeInfo
  303. */
  304. void EXIF_API_EXPORT_CALL exif_freeTagInfo(void* tag);
  305. /**
  306. * queryTagNodeIsExist()
  307. *
  308. * Query if the specified tag node is exist in the IFD tables
  309. *
  310. * parameters
  311. * [in] ifdTableArray: address of the IFD tables array
  312. * [in] ifdType : target IFD type
  313. * [in] tagId : target tag ID
  314. *
  315. * return
  316. * 0: not exist
  317. * 1: exist
  318. */
  319. int EXIF_API_EXPORT_CALL exif_queryTagNodeIsExist(void** ifdTableArray,
  320. EXIF_IFD_TYPE ifdType,
  321. uint16_t tagId);
  322. /**
  323. * createTagInfo()
  324. *
  325. * Create new TagNodeInfo block
  326. *
  327. * parameters
  328. * [in] tagId: id of the tag
  329. * [in] type: type of the tag
  330. * [in] count: data count of the tag
  331. * [out] pResult : error status
  332. * 0: OK
  333. * -n: error
  334. * ERR_INVALID_TYPE
  335. * ERR_INVALID_COUNT
  336. * ERR_MEMALLOC
  337. *
  338. * return
  339. * NULL: error
  340. * !NULL: address of the newly created TagNodeInfo
  341. */
  342. ExifTagNodeInfo EXIF_API_EXPORT * EXIF_API_CALL exif_createTagInfo(uint16_t tagId,
  343. uint16_t type,
  344. unsigned int count,
  345. int* pResult);
  346. /**
  347. * removeIfdTableFromIfdTableArray()
  348. *
  349. * Remove the IFD table from the ifdTableArray
  350. *
  351. * parameters
  352. * [in] ifdTableArray: address of the IFD tables array
  353. * [in] ifdType : target IFD type
  354. *
  355. * return
  356. * n: number of the removed IFD tables
  357. */
  358. int EXIF_API_EXPORT_CALL exif_removeIfdTableFromIfdTableArray(void** ifdTableArray, EXIF_IFD_TYPE ifdType);
  359. /**
  360. * insertIfdTableToIfdTableArray()
  361. *
  362. * Insert new IFD table to the ifdTableArray
  363. *
  364. * parameters
  365. * [in] ifdTableArray: address of the IFD tables array
  366. * [in] ifdType : target IFD type
  367. * [out] pResult : result status
  368. * 0: OK
  369. * -n: error
  370. * ERR_INVALID_POINTER
  371. * ERR_ALREADY_EXIST
  372. * ERR_MEMALLOC
  373. *
  374. * return
  375. * NULL: error
  376. * !NULL: address of the newly created ifdTableArray
  377. *
  378. * note
  379. * This function frees old ifdTableArray if is not NULL.
  380. */
  381. void EXIF_API_EXPORT ** EXIF_API_CALL exif_insertIfdTableToIfdTableArray(void** ifdTableArray,
  382. EXIF_IFD_TYPE ifdType,
  383. int* pResult);
  384. /**
  385. * removeTagNodeFromIfdTableArray()
  386. *
  387. * Remove the specified tag node from the IFD table
  388. *
  389. * parameters
  390. * [in] ifdTableArray: address of the IFD tables array
  391. * [in] ifdType : target IFD type
  392. * [in] tagId : target tag ID
  393. *
  394. * return
  395. * n: number of the removed tags
  396. */
  397. int EXIF_API_EXPORT_CALL exif_removeTagNodeFromIfdTableArray(void** ifdTableArray,
  398. EXIF_IFD_TYPE ifdType,
  399. uint16_t tagId);
  400. /**
  401. * insertTagNodeToIfdTableArray()
  402. *
  403. * Insert the specified tag node to the IFD table
  404. *
  405. * parameters
  406. * [in] ifdTableArray: address of the IFD tables array
  407. * [in] ifdType : target IFD type
  408. * [in] tagNodeInfo: address of the TagNodeInfo
  409. *
  410. * note
  411. * This function uses the copy of the specified tag data.
  412. * The caller must free it after this function returns.
  413. *
  414. * return
  415. * 0: OK
  416. * ERR_INVALID_POINTER:
  417. * ERR_NOT_EXIST:
  418. * ERR_ALREADY_EXIST:
  419. * ERR_UNKNOWN:
  420. */
  421. int EXIF_API_EXPORT_CALL exif_insertTagNodeToIfdTableArray(void** ifdTableArray,
  422. EXIF_IFD_TYPE ifdType,
  423. ExifTagNodeInfo* tagNodeInfo);
  424. /**
  425. * getThumbnailDataOnIfdTableArray()
  426. *
  427. * Get a copy of the thumbnail data from the 1st IFD table
  428. *
  429. * parameters
  430. * [in] ifdTableArray : address of the IFD tables array
  431. * [out] pLength : returns the length of the thumbnail data
  432. * [out] pResult : result status
  433. * 0: OK
  434. * -n: error
  435. * ERR_INVALID_POINTER
  436. * ERR_MEMALLOC
  437. * ERR_NOT_EXIST
  438. *
  439. * return
  440. * NULL: error
  441. * !NULL: the thumbnail data
  442. *
  443. * note
  444. * This function returns the copy of the thumbnail data.
  445. * The caller must free it.
  446. */
  447. uint8_t EXIF_API_EXPORT * EXIF_API_CALL exif_getThumbnailDataOnIfdTableArray(void** ifdTableArray,
  448. unsigned int* pLength,
  449. int* pResult);
  450. /**
  451. * setThumbnailDataOnIfdTableArray()
  452. *
  453. * Set or update the thumbnail data to the 1st IFD table
  454. *
  455. * parameters
  456. * [in] ifdTableArray : address of the IFD tables array
  457. * [in] pData : thumbnail data
  458. * [in] length : thumbnail data length
  459. *
  460. * note
  461. * This function creates the copy of the specified data.
  462. * The caller must free it after this function returns.
  463. *
  464. * return
  465. * 0: OK
  466. * -n: error
  467. * ERR_INVALID_POINTER
  468. * ERR_MEMALLOC
  469. * ERR_UNKNOWN
  470. */
  471. int EXIF_API_EXPORT_CALL exif_setThumbnailDataOnIfdTableArray(void** ifdTableArray,
  472. uint8_t* pData,
  473. unsigned int length);
  474. void EXIF_API_EXPORT_CALL exif_getIfdTableDump(void* pIfd, char** pp);
  475. /**
  476. * updateExifSegmentInJPEGFile()
  477. *
  478. * Update the Exif segment in a JPEG file
  479. *
  480. * parameters
  481. * [in] inJPEGFileName : original JPEG file
  482. * [in] outJPGEFileName : output JPEG file
  483. * [in] ifdTableArray : address of the IFD tables array
  484. *
  485. * return
  486. * 1: OK
  487. * -n: error
  488. * ERR_READ_FILE
  489. * ERR_WRITE_FILE
  490. * ERR_INVALID_JPEG
  491. * ERR_INVALID_APP1HEADER
  492. * ERR_INVALID_POINTER
  493. * ERROR_UNKNOWN:
  494. */
  495. int EXIF_API_EXPORT_CALL exif_updateExifSegmentInJPEGFile(const char* inJPEGFileName,
  496. const char* outJPGEFileName,
  497. void** ifdTableArray);
  498. void EXIF_API_EXPORT_CALL exif_getIfdTableDump(void* pIfd, char** pp);
  499. /**
  500. * removeAdobeMetadataSegmentFromJPEGFile()
  501. *
  502. * Remove Adobe's XMP metadata segment from a JPEG file
  503. *
  504. * parameters
  505. * [in] inJPEGFileName : original JPEG file
  506. * [in] outJPGEFileName : output JPEG file
  507. *
  508. * return
  509. * 1: OK
  510. * 0: Adobe's metadata segment is not found
  511. * -n: error
  512. * ERR_READ_FILE
  513. * ERR_WRITE_FILE
  514. * ERR_INVALID_JPEG
  515. * ERR_INVALID_APP1HEADER
  516. */
  517. int EXIF_API_EXPORT_CALL exif_removeAdobeMetadataSegmentFromJPEGFile(const char* inJPEGFileName,
  518. const char* outJPGEFileName);
  519. // Tag IDs
  520. // 0th IFD, 1st IFD, Exif IFD
  521. #define TAG_ImageWidth 0x0100
  522. #define TAG_ImageLength 0x0101
  523. #define TAG_BitsPerSample 0x0102
  524. #define TAG_Compression 0x0103
  525. #define TAG_PhotometricInterpretation 0x0106
  526. #define TAG_Orientation 0x0112
  527. #define TAG_SamplesPerPixel 0x0115
  528. #define TAG_PlanarConfiguration 0x011C
  529. #define TAG_YCbCrSubSampling 0x0212
  530. #define TAG_YCbCrPositioning 0x0213
  531. #define TAG_XResolution 0x011A
  532. #define TAG_YResolution 0x011B
  533. #define TAG_ResolutionUnit 0x0128
  534. #define TAG_StripOffsets 0x0111
  535. #define TAG_RowsPerStrip 0x0116
  536. #define TAG_StripByteCounts 0x0117
  537. #define TAG_JPEGInterchangeFormat 0x0201
  538. #define TAG_JPEGInterchangeFormatLength 0x0202
  539. #define TAG_TransferFunction 0x012D
  540. #define TAG_WhitePoint 0x013E
  541. #define TAG_PrimaryChromaticities 0x013F
  542. #define TAG_YCbCrCoefficients 0x0211
  543. #define TAG_ReferenceBlackWhite 0x0214
  544. #define TAG_DateTime 0x0132
  545. #define TAG_ImageDescription 0x010E
  546. #define TAG_Make 0x010F
  547. #define TAG_Model 0x0110
  548. #define TAG_Software 0x0131
  549. #define TAG_Artist 0x013B
  550. #define TAG_Copyright 0x8298
  551. #define TAG_ExifIFDPointer 0x8769
  552. #define TAG_GPSInfoIFDPointer 0x8825
  553. #define TAG_InteroperabilityIFDPointer 0xA005
  554. #define TAG_Rating 0x4746
  555. #define TAG_ExifVersion 0x9000
  556. #define TAG_FlashPixVersion 0xA000
  557. #define TAG_ColorSpace 0xA001
  558. #define TAG_ComponentsConfiguration 0x9101
  559. #define TAG_CompressedBitsPerPixel 0x9102
  560. #define TAG_PixelXDimension 0xA002
  561. #define TAG_PixelYDimension 0xA003
  562. #define TAG_MakerNote 0x927C
  563. #define TAG_UserComment 0x9286
  564. #define TAG_RelatedSoundFile 0xA004
  565. #define TAG_DateTimeOriginal 0x9003
  566. #define TAG_DateTimeDigitized 0x9004
  567. #define TAG_SubSecTime 0x9290
  568. #define TAG_SubSecTimeOriginal 0x9291
  569. #define TAG_SubSecTimeDigitized 0x9292
  570. #define TAG_ExposureTime 0x829A
  571. #define TAG_FNumber 0x829D
  572. #define TAG_ExposureProgram 0x8822
  573. #define TAG_SpectralSensitivity 0x8824
  574. #define TAG_PhotographicSensitivity 0x8827
  575. #define TAG_OECF 0x8828
  576. #define TAG_SensitivityType 0x8830
  577. #define TAG_StandardOutputSensitivity 0x8831
  578. #define TAG_RecommendedExposureIndex 0x8832
  579. #define TAG_ISOSpeed 0x8833
  580. #define TAG_ISOSpeedLatitudeyyy 0x8834
  581. #define TAG_ISOSpeedLatitudezzz 0x8835
  582. #define TAG_ShutterSpeedValue 0x9201
  583. #define TAG_ApertureValue 0x9202
  584. #define TAG_BrightnessValue 0x9203
  585. #define TAG_ExposureBiasValue 0x9204
  586. #define TAG_MaxApertureValue 0x9205
  587. #define TAG_SubjectDistance 0x9206
  588. #define TAG_MeteringMode 0x9207
  589. #define TAG_LightSource 0x9208
  590. #define TAG_Flash 0x9209
  591. #define TAG_FocalLength 0x920A
  592. #define TAG_SubjectArea 0x9214
  593. #define TAG_FlashEnergy 0xA20B
  594. #define TAG_SpatialFrequencyResponse 0xA20C
  595. #define TAG_FocalPlaneXResolution 0xA20E
  596. #define TAG_FocalPlaneYResolution 0xA20F
  597. #define TAG_FocalPlaneResolutionUnit 0xA210
  598. #define TAG_SubjectLocation 0xA214
  599. #define TAG_ExposureIndex 0xA215
  600. #define TAG_SensingMethod 0xA217
  601. #define TAG_FileSource 0xA300
  602. #define TAG_SceneType 0xA301
  603. #define TAG_CFAPattern 0xA302
  604. #define TAG_CustomRendered 0xA401
  605. #define TAG_ExposureMode 0xA402
  606. #define TAG_WhiteBalance 0xA403
  607. #define TAG_DigitalZoomRatio 0xA404
  608. #define TAG_FocalLengthIn35mmFormat 0xA405
  609. #define TAG_SceneCaptureType 0xA406
  610. #define TAG_GainControl 0xA407
  611. #define TAG_Contrast 0xA408
  612. #define TAG_Saturation 0xA409
  613. #define TAG_Sharpness 0xA40A
  614. #define TAG_DeviceSettingDescription 0xA40B
  615. #define TAG_SubjectDistanceRange 0xA40C
  616. #define TAG_ImageUniqueID 0xA420
  617. #define TAG_CameraOwnerName 0xA430
  618. #define TAG_BodySerialNumber 0xA431
  619. #define TAG_LensSpecification 0xA432
  620. #define TAG_LensMake 0xA433
  621. #define TAG_LensModel 0xA434
  622. #define TAG_LensSerialNumber 0xA435
  623. #define TAG_Gamma 0xA500
  624. #define TAG_PrintIM 0xC4A5
  625. #define TAG_Padding 0xEA1C
  626. // GPS IFD
  627. #define TAG_GPSVersionID 0x0000
  628. #define TAG_GPSLatitudeRef 0x0001
  629. #define TAG_GPSLatitude 0x0002
  630. #define TAG_GPSLongitudeRef 0x0003
  631. #define TAG_GPSLongitude 0x0004
  632. #define TAG_GPSAltitudeRef 0x0005
  633. #define TAG_GPSAltitude 0x0006
  634. #define TAG_GPSTimeStamp 0x0007
  635. #define TAG_GPSSatellites 0x0008
  636. #define TAG_GPSStatus 0x0009
  637. #define TAG_GPSMeasureMode 0x000A
  638. #define TAG_GPSDOP 0x000B
  639. #define TAG_GPSSpeedRef 0x000C
  640. #define TAG_GPSSpeed 0x000D
  641. #define TAG_GPSTrackRef 0x000E
  642. #define TAG_GPSTrack 0x000F
  643. #define TAG_GPSImgDirectionRef 0x0010
  644. #define TAG_GPSImgDirection 0x0011
  645. #define TAG_GPSMapDatum 0x0012
  646. #define TAG_GPSDestLatitudeRef 0x0013
  647. #define TAG_GPSDestLatitude 0x0014
  648. #define TAG_GPSDestLongitudeRef 0x0015
  649. #define TAG_GPSDestLongitude 0x0016
  650. #define TAG_GPSBearingRef 0x0017
  651. #define TAG_GPSBearing 0x0018
  652. #define TAG_GPSDestDistanceRef 0x0019
  653. #define TAG_GPSDestDistance 0x001A
  654. #define TAG_GPSProcessingMethod 0x001B
  655. #define TAG_GPSAreaInformation 0x001C
  656. #define TAG_GPSDateStamp 0x001D
  657. #define TAG_GPSDifferential 0x001E
  658. #define TAG_GPSHPositioningError 0x001F
  659. // Interoperability IFD
  660. #define TAG_InteroperabilityIndex 0x0001
  661. #define TAG_InteroperabilityVersion 0x0002
  662. #define TAG_RelatedImageFileFormat 0x1000
  663. #define TAG_RelatedImageWidth 0x1001
  664. #define TAG_RelatedImageHeight 0x1002
  665. // MPF tags
  666. #define TAG_MPFVersion 0xB000
  667. #define TAG_NumberOfImage 0xB001
  668. #define TAG_MPImageList 0xB002
  669. #define TAG_ImageUIDList 0xB003
  670. #define TAG_TotalFrames 0xB004
  671. #define TAG_MPIndividualNum 0xB101
  672. #define TAG_PanOrientation 0xB201
  673. #define TAG_PanOverlapH 0xB202
  674. #define TAG_PanOverlapV 0xB203
  675. #define TAG_BaseViewpointNum 0xB204
  676. #define TAG_ConvergenceAngle 0xB205
  677. #define TAG_BaselineLength 0xB206
  678. #define TAG_VerticalDivergence 0xB207
  679. #define TAG_AxisDistanceX 0xB208
  680. #define TAG_AxisDistanceY 0xB209
  681. #define TAG_AxisDistanceZ 0xB20A
  682. #define TAG_YawAngle 0xB20B
  683. #define TAG_PitchAngle 0xB20C
  684. #define TAG_RollAngle 0xB20D
  685. #ifdef __cplusplus
  686. } /* extern "C" */
  687. #endif
  688. #endif // _EXIF_H_