1 /*
2  * phoexif.c: glue between pho and the jhead exif code.
3  *
4  * Copyright 2002 by Akkana Peck.
5  * You are free to use or modify this code under the Gnu Public License.
6  */
7 
8 #ifndef PHOEXIF_H
9 #define PHOEXIF_H 1
10 
11 typedef enum { ExifString, ExifInt, ExifFloat } ExifDataType;
12 
13 struct ExifTypes_s {
14     char* str;
15     ExifDataType type;
16 };
17 
18 /* Loop over ExifLabels[] in order to make a list of possible fields. */
19 extern struct ExifTypes_s ExifLabels[];
20 
21 /* The fields of this enum must correspond with the positions
22  * in ExifLabels[].
23  */
24 typedef enum
25 {
26     ExifCameraMake = 0,
27     ExifCameraModel,
28     ExifDate,
29     ExifOrientation,
30     ExifColor,
31     ExifFlash,
32     ExifFocalLength,
33     ExifExposureTime,
34     ExifAperture,
35     ExifDistance,
36     ExifCCDWidth,
37     ExifExposureBias,
38     ExifWhiteBalance,
39     ExifMetering,
40     ExifExposureProgram,
41     ExifISO,
42     ExifCompression,
43     ExifComments,
44     ExifThumbnailSize
45 } ExifFields_e;
46 
47 /*#define NUM_EXIF_FIELDS  (sizeof ExifLabels / sizeof (*ExifLabels))*/
48 #define NUM_EXIF_FIELDS  19
49 
50 /*
51  * You must call ExifReadInfo() before you call ExifGet*()!
52  */
53 extern void ExifReadInfo(char* filename);
54 
55 /*
56  * Do selected operations to one file at a time.
57 */
58 extern void ProcessFile(const char * FileName);
59 
60 /*
61  * This tells us whether we have good EXIF data
62  * on the current image.
63  */
64 extern int HasExif();
65 
66 /* ExifGetString() returns a pointer to a STATIC buffer.
67  * Copy it if you want to keep it!
68  * It will work even the type is not a string (will translate appropriately).
69  * ExifGetInt() and ExifGetFloat() do the obvious, simpler, things.
70  */
71 extern const char* ExifGetString(ExifFields_e field);
72 extern         int ExifGetInt(ExifFields_e field);
73 extern       float ExifGetFloat(ExifFields_e field);
74 
75 
76 #endif /* PHOEXIF_H */
77 
78