9 #define EXIF_EXPORT __declspec(dllexport)
17 //--------------------------------------------------------------------------
18 // JPEG markers consist of one or more 0xFF bytes, followed by a marker
19 // code byte (which is not an FF). Here are the marker codes of interest
20 // in this application.
21 //--------------------------------------------------------------------------
23 #define M_SOF0 0xC0 // Start Of Frame N
24 #define M_SOF1 0xC1 // N indicates which compression process
25 #define M_SOF2 0xC2 // Only SOF0-SOF2 are now in common use
27 #define M_SOF5 0xC5 // NB: codes C4 and CC are NOT SOF markers
36 #define M_SOI 0xD8 // Start Of Image (beginning of datastream)
37 #define M_EOI 0xD9 // End Of Image (end of datastream)
38 #define M_SOS 0xDA // Start Of Scan (begins compressed data)
39 #define M_JFIF 0xE0 // Jfif marker
40 #define M_EXIF 0xE1 // Exif marker
41 #define M_COM 0xFE // COMment
45 #define M_IPTC 0xED // IPTC marker
47 #define MAX_IPTC_STRING 256
50 char RecordVersion
[MAX_IPTC_STRING
];
51 char SupplementalCategories
[MAX_IPTC_STRING
];
52 char Keywords
[MAX_IPTC_STRING
];
53 char Caption
[MAX_IPTC_STRING
];
54 char Author
[MAX_IPTC_STRING
];
55 char Headline
[MAX_IPTC_STRING
];
56 char SpecialInstructions
[MAX_IPTC_STRING
];
57 char Category
[MAX_IPTC_STRING
];
58 char Byline
[MAX_IPTC_STRING
];
59 char BylineTitle
[MAX_IPTC_STRING
];
60 char Credit
[MAX_IPTC_STRING
];
61 char Source
[MAX_IPTC_STRING
];
62 char CopyrightNotice
[MAX_IPTC_STRING
];
63 char ObjectName
[MAX_IPTC_STRING
];
64 char City
[MAX_IPTC_STRING
];
65 char State
[MAX_IPTC_STRING
];
66 char Country
[MAX_IPTC_STRING
];
67 char TransmissionReference
[MAX_IPTC_STRING
];
68 char Date
[MAX_IPTC_STRING
];
69 char Urgency
[MAX_IPTC_STRING
];
70 char ReferenceService
[MAX_IPTC_STRING
];
71 char CountryCode
[MAX_IPTC_STRING
];
72 char TimeCreated
[MAX_IPTC_STRING
];
73 char SubLocation
[MAX_IPTC_STRING
];
74 char ImageType
[MAX_IPTC_STRING
];
77 #define EXIF_COMMENT_CHARSET_CONVERTED -1 // Comments contains converted data
78 #define EXIF_COMMENT_CHARSET_UNKNOWN 0 // Exif: Unknown
79 #define EXIF_COMMENT_CHARSET_ASCII 2 // Exif: Ascii
80 #define EXIF_COMMENT_CHARSET_UNICODE 3 // Exif: Unicode (UTF-16)
81 #define EXIF_COMMENT_CHARSET_JIS 4 // Exif: JIS X208-1990
83 #define MAX_COMMENT 2000
84 #define MAX_DATE_COPIES 10
88 char CameraModel
[41];
97 float ApertureFNumber
;
101 float DigitalZoomRatio
;
102 int FocalLength35mmEquiv
; // Exif 2.2 tag - usually not present.
109 int CommentsCharset
; // EXIF_COMMENT_CHARSET_*
110 int XPCommentsCharset
;
111 char Comments
[MAX_COMMENT
+ 1]; // +1 for null termination
112 char FileComment
[MAX_COMMENT
+ 1];
113 char XPComment
[MAX_COMMENT
+ 1];
114 char Description
[MAX_COMMENT
+ 1];
116 unsigned ThumbnailOffset
; // Exif offset to thumbnail
117 unsigned ThumbnailSize
; // Size of thumbnail.
118 unsigned LargestExifOffset
; // Last exif data referenced (to check if thumbnail is at end)
120 char ThumbnailAtEnd
; // Exif header ends with the thumbnail
121 // (we can only modify the thumbnail if its at the end)
122 int ThumbnailSizeOffset
;
124 int DateTimeOffsets
[MAX_DATE_COPIES
];
133 EXIF_EXPORT
bool process_jpeg(const char *filename
, ExifInfo_t
*exifInfo
, IPTCInfo_t
*iptcInfo
);