diff options
author | Christian Fetzer <fetzer.ch@googlemail.com> | 2011-10-17 23:51:58 +0200 |
---|---|---|
committer | Christian Fetzer <fetzer.ch@googlemail.com> | 2012-03-26 18:36:06 +0200 |
commit | 3333a9bb22b5fe8c7eba6b4f56e314401c3e0e34 (patch) | |
tree | 524895eadd3d9eb7c3a2894f9a59f08a36abf5f1 | |
parent | 8c38ea623f1ddb819d03ffcff7078e7b0b2c4af7 (diff) |
Added support for the exif ImageDescription tag to libexif and made it accessible through slideshow.exifdescription.
-rw-r--r-- | lib/libexif/ExifParse.cpp | 8 | ||||
-rw-r--r-- | lib/libexif/libexif.h | 1 | ||||
-rw-r--r-- | xbmc/pictures/PictureInfoTag.cpp | 9 |
3 files changed, 14 insertions, 4 deletions
diff --git a/lib/libexif/ExifParse.cpp b/lib/libexif/ExifParse.cpp index 74ecbbef78..a905e80c54 100644 --- a/lib/libexif/ExifParse.cpp +++ b/lib/libexif/ExifParse.cpp @@ -413,7 +413,13 @@ void CExifParse::ProcessDir(const unsigned char* const DirStart, // Extract useful components of tag switch(Tag) { -// case TAG_DESCRIPTION: strncpy(m_ExifInfo->Description, ValuePtr, 5); break; + case TAG_DESCRIPTION: + { + int length = max(ByteCount, 0); + length = min(length, 2000); + strncpy(m_ExifInfo->Description, (char *)ValuePtr, length); + break; + } case TAG_MAKE: strncpy(m_ExifInfo->CameraMake, (char *)ValuePtr, 32); break; case TAG_MODEL: strncpy(m_ExifInfo->CameraModel, (char *)ValuePtr, 40); break; // case TAG_SOFTWARE: strncpy(m_ExifInfo->Software, ValuePtr, 5); break; diff --git a/lib/libexif/libexif.h b/lib/libexif/libexif.h index e889892a73..204f99d35d 100644 --- a/lib/libexif/libexif.h +++ b/lib/libexif/libexif.h @@ -98,6 +98,7 @@ typedef struct { int ISOequivalent; int LightSource; char Comments[MAX_COMMENT]; + char Description[MAX_COMMENT]; unsigned ThumbnailOffset; // Exif offset to thumbnail unsigned ThumbnailSize; // Size of thumbnail. diff --git a/xbmc/pictures/PictureInfoTag.cpp b/xbmc/pictures/PictureInfoTag.cpp index e286d7ffa3..1acdd4c36d 100644 --- a/xbmc/pictures/PictureInfoTag.cpp +++ b/xbmc/pictures/PictureInfoTag.cpp @@ -66,6 +66,7 @@ void CPictureInfoTag::Archive(CArchive& ar) ar << CStdString(m_exifInfo.CameraModel); ar << m_exifInfo.CCDWidth; ar << CStdString(m_exifInfo.Comments); + ar << CStdString(m_exifInfo.Description); ar << CStdString(m_exifInfo.DateTime); for (int i = 0; i < 10; i++) ar << m_exifInfo.DateTimeOffsets[i]; @@ -128,6 +129,7 @@ void CPictureInfoTag::Archive(CArchive& ar) GetStringFromArchive(ar, m_exifInfo.CameraModel, sizeof(m_exifInfo.CameraModel)); ar >> m_exifInfo.CCDWidth; GetStringFromArchive(ar, m_exifInfo.Comments, sizeof(m_exifInfo.Comments)); + GetStringFromArchive(ar, m_exifInfo.Description, sizeof(m_exifInfo.Description)); GetStringFromArchive(ar, m_exifInfo.DateTime, sizeof(m_exifInfo.DateTime)); for (int i = 0; i < 10; i++) ar >> m_exifInfo.DateTimeOffsets[i]; @@ -191,6 +193,7 @@ void CPictureInfoTag::Serialize(CVariant& value) value["cameramodel"] = CStdString(m_exifInfo.CameraModel); value["ccdwidth"] = m_exifInfo.CCDWidth; value["comments"] = CStdString(m_exifInfo.Comments); + value["description"] = CStdString(m_exifInfo.Description); value["datetime"] = CStdString(m_exifInfo.DateTime); for (int i = 0; i < 10; i++) value["datetimeoffsets"][i] = m_exifInfo.DateTimeOffsets[i]; @@ -311,9 +314,9 @@ const CStdString CPictureInfoTag::GetInfo(int info) const value = date.GetAsLocalizedDateTime(); } break; -// case SLIDE_EXIF_DESCRIPTION: -// value = m_exifInfo.Description; -// break; + case SLIDE_EXIF_DESCRIPTION: + value = m_exifInfo.Description; + break; case SLIDE_EXIF_CAMERA_MAKE: value = m_exifInfo.CameraMake; break; |