diff options
Diffstat (limited to '')
-rw-r--r-- | xbmc/pictures/libexif.cpp | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/xbmc/pictures/libexif.cpp b/xbmc/pictures/libexif.cpp new file mode 100644 index 0000000..3ee75b9 --- /dev/null +++ b/xbmc/pictures/libexif.cpp @@ -0,0 +1,35 @@ +// libexif.cpp : Defines the entry point for the console application. +// + +#include "libexif.h" + +#include "JpegParse.h" + +#ifdef TARGET_WINDOWS +#include <windows.h> +#else +#include <memory.h> +#include <cstring> +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +bool process_jpeg(const char *filename, ExifInfo_t *exifInfo, IPTCInfo_t *iptcInfo) +{ + if (!exifInfo || !iptcInfo) return false; + CJpegParse jpeg; + memset(exifInfo, 0, sizeof(ExifInfo_t)); + memset(iptcInfo, 0, sizeof(IPTCInfo_t)); + if (jpeg.Process(filename)) + { + memcpy(exifInfo, jpeg.GetExifInfo(), sizeof(ExifInfo_t)); + memcpy(iptcInfo, jpeg.GetIptcInfo(), sizeof(IPTCInfo_t)); + return true; + } + return false; +} +#ifdef __cplusplus +} +#endif |