exif.h
Go to the documentation of this file.00001
00012 #ifndef _gphoto_exif_
00013 #define _gphoto_exif_
00014 #include <stdio.h>
00015 #include <stdlib.h>
00016 #include <string.h>
00017 #include <time.h>
00018 #include <sys/time.h>
00019 #include <fcntl.h>
00020
00021
00022
00023
00024
00025 typedef enum {
00026 EXIF_NOTYPE = 0,
00027 EXIF_BYTE = 1,
00028 EXIF_ASCII = 2,
00029 EXIF_SHORT = 3,
00030 EXIF_LONG = 4,
00031 EXIF_RATIONAL = 5,
00032 EXIF_SBYTE = 6,
00033 EXIF_UNDEFINED = 7,
00034 EXIF_SSHORT = 8,
00035 EXIF_SLONG = 9,
00036 EXIF_SRATIONAL = 10,
00037 EXIF_FLOAT = 11,
00038 EXIF_DOUBLE = 12
00039 } EXIFDataType;
00040
00041
00042 typedef struct exif_parser {
00043 unsigned char *header,*data,*ifds[10];
00044 int ifdtags[10];
00045 int ifdcnt;
00046 unsigned int exiflen;
00047 int preparsed,endian;
00048 } exifparser;
00049
00050 typedef struct {
00051 int tag;
00052 EXIFDataType type;
00053 int size;
00054 unsigned char *data;
00055 int num;
00056 int den;
00057 int intval;
00058 } ExifData;
00059
00060
00061
00062
00063
00064 unsigned char *gpi_exif_get_thumbnail_and_size(exifparser *exifdat, long *size);
00065
00066
00067
00068
00069 int gpi_exif_stat(exifparser *exifdata);
00070
00071
00072
00073
00074
00075 #define EXIF_InteroperabilityIndex 0x1
00076 #define EXIF_InteroperabilityVersion 0x2
00077 #define EXIF_RelatedImageFileFormat 0x1000
00078 #define EXIF_RelatedImageWidth 0x1001
00079 #define EXIF_RelatedImageLength 0x1002
00080
00081 #define EXIF_NewSubFileType 0xFE
00082 #define EXIF_ImageWidth 0x100
00083 #define EXIF_ImageLength 0x101
00084 #define EXIF_BitsPerSample 0x102
00085 #define EXIF_Compression 0x103
00086 #define EXIF_PhotometricInterpretation 0x106
00087 #define EXIF_FillOrder 0x10A
00088 #define EXIF_DocumentName 0x10D
00089 #define EXIF_ImageDescription 0x10E
00090 #define EXIF_Make 0x10F
00091 #define EXIF_Model 0x110
00092 #define EXIF_StripOffsets 0x111
00093 #define EXIF_Orientation 0x112
00094 #define EXIF_SamplesPerPixel 0x115
00095 #define EXIF_RowsPerStrip 0x116
00096 #define EXIF_StripByteCounts 0x117
00097 #define EXIF_XResolution 0x11A
00098 #define EXIF_YResolution 0x11B
00099 #define EXIF_PlanarConfiguration 0x11C
00100 #define EXIF_ResolutionUnit 0x128
00101 #define EXIF_TransferFunction 0x12D
00102 #define EXIF_Software 0x131
00103 #define EXIF_DateTime 0x132
00104 #define EXIF_Artist 0x13B
00105 #define EXIF_WhitePoint 0x13E
00106 #define EXIF_PrimaryChromaticities 0x13F
00107 #define EXIF_TransferRange 0x156
00108 #define EXIF_JPEGProc 0x200
00109 #define EXIF_JPEGInterchangeFormat 0x201
00110 #define EXIF_JPEGInterchangeFormatLength 0x202
00111 #define EXIF_YCbCrCoefficients 0x211
00112 #define EXIF_YCbCrSubSampling 0x212
00113 #define EXIF_YCbCrPositioning 0x213
00114 #define EXIF_ReferenceBlackWhite 0x214
00115 #define EXIF_CFARepeatPatternDim 0x828D
00116 #define EXIF_CFAPattern 0x828E
00117 #define EXIF_BatteryLevel 0x828F
00118 #define EXIF_Copyright 0x8298
00119 #define EXIF_ExposureTime 0x829A
00120 #define EXIF_FNumber 0x829D
00121
00122
00123 #define EXIF_IPTC_NAA 0x83BB
00124 #define EXIF_ExifOffset 0x8769
00125 #define EXIF_InterColorProfile 0x8773
00126 #define EXIF_ExposureProgram 0x8822
00127 #define EXIF_SpectralSensitivity 0x8824
00128 #define EXIF_GPSInfo 0x8825
00129 #define EXIF_ISOSpeedRatings 0x8827
00130 #define EXIF_OECF 0x8828
00131 #define EXIF_ExifVersion 0x9000
00132 #define EXIF_DateTimeOriginal 0x9003
00133 #define EXIF_DateTimeDigitized 0x9004
00134 #define EXIF_ComponentsConfiguration 0x9101
00135 #define EXIF_CompressedBitsPerPixel 0x9102
00136 #define EXIF_ShutterSpeedValue 0x9201
00137 #define EXIF_ApertureValue 0x9202
00138 #define EXIF_BrightnessValue 0x9203
00139 #define EXIF_ExposureBiasValue 0x9204
00140 #define EXIF_MaxApertureValue 0x9205
00141 #define EXIF_SubjectDistance 0x9206
00142 #define EXIF_MeteringMode 0x9207
00143 #define EXIF_LightSource 0x9208
00144 #define EXIF_Flash 0x9209
00145 #define EXIF_FocalLength 0x920A
00146 #define EXIF_MakerNote 0x927C
00147 #define EXIF_UserComment 0x9286
00148 #define EXIF_SubSecTime 0x9290
00149 #define EXIF_SubSecTimeOriginal 0x9291
00150 #define EXIF_SubSecTimeDigitized 0x9292
00151 #define EXIF_FlashPixVersion 0xA000
00152 #define EXIF_ColorSpace 0xA001
00153 #define EXIF_ExifImageWidth 0xA002
00154 #define EXIF_ExifImageLength 0xA003
00155 #define EXIF_InteroperabilityOffset 0xA005
00156 #define EXIF_FlashEnergy 0xA20B
00157 #define EXIF_SpatialFrequencyResponse 0xA20C
00158 #define EXIF_FocalPlaneXResolution 0xA20E
00159 #define EXIF_FocalPlaneYResolution 0xA20F
00160 #define EXIF_FocalPlaneResolutionUnit 0xA210
00161 #define EXIF_SubjectLocation 0xA214
00162 #define EXIF_ExposureIndex 0xA215
00163 #define EXIF_SensingMethod 0xA217
00164 #define EXIF_FileSource 0xA300
00165 #define EXIF_SceneType 0xA301
00166
00167 #endif