Debian Codegraph @

xbmc/pictures/libexif.cpp

raw
1 // libexif.cpp : Defines the entry point for the console application.
2 //
3
4 #include "libexif.h"
5
6 #include "JpegParse.h"
7
8 #ifdef TARGET_WINDOWS
9 #include <windows.h>
10 #else
11 #include <memory.h>
12 #include <cstring>
13 #endif
14
15 #ifdef __cplusplus
16 extern "C" {
17 #endif
18
19 bool process_jpeg(const char *filename, ExifInfo_t *exifInfo, IPTCInfo_t *iptcInfo)
20 {
21 if (!exifInfo || !iptcInfo) return false;
22 CJpegParse jpeg;
23 memset(exifInfo, 0, sizeof(ExifInfo_t));
24 memset(iptcInfo, 0, sizeof(IPTCInfo_t));
25 if (jpeg.Process(filename))
26 {
27 memcpy(exifInfo, jpeg.GetExifInfo(), sizeof(ExifInfo_t));
28 memcpy(iptcInfo, jpeg.GetIptcInfo(), sizeof(IPTCInfo_t));
29 return true;
30 }
31 return false;
32 }
33 #ifdef __cplusplus
34 }
35 #endif