Make picture tags complete and consistent #2494

Merged
merged 1 commit into from Apr 8, 2013

3 participants

@smfontes

I posted a thread explaining what this commit is for.

http://forum.xbmc.org/showthread.php?tid=158723

It makes all of the available picture info accessible for skins or addons to use to overlay on pictures when they are selected from the picture list, or from slideshows when they are displaying a picture. Or just for addons to use as needed.

This commit makes all of the picture metadata retrieved from a file available as both slideshow.* INFO variables and ListItem.Picture* INFO variables.

There is an additional fix in this commit. The IPTC code 0x0A does not represent a Copyright code - there is no such thing as a copyright code. The IPTC code 0x0A is the code for IPTC.Urgency. I fixed this in the libexif source. I also changed the variables for copyright code to urgency in the XBMC code. Typically, urgency is used for rating pictures. A variety of image editing programs store rating in the urgency field. So we now have a way to make picture rating available in XBMC.

@smfontes smfontes commented on the diff Mar 24, 2013
language/English/strings.po
@@ -10041,7 +10041,19 @@ msgctxt "#21843"
msgid "Orientation"
msgstr ""
-#empty strings from id 21844 to 21859
+#empty strings from id 21844 to 21856

Needed to add three new strings for the three new pieces of metadata

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@smfontes smfontes commented on the diff Mar 24, 2013
language/English/strings.po
@@ -10116,7 +10128,7 @@ msgid "Date created"
msgstr ""
msgctxt "#21878"
-msgid "Copyright flag"

No such metadata as copyright flag - the 0x0a field is IPTC.Urgency - which is typically used for picture rating (1-5 stars)

@MartijnKaijser
Team Kodi member

If you are going to remove that msgid you need to replace that block with

empty string id 21878
@MartijnKaijser
Team Kodi member

oh nevermind the noise. didn't saw the full changes.

@MartijnKaijser
Team Kodi member

however you need to change from stringid as Transifex will not see the changes in you made. So pick an empty string ID and make this one empty like i mentioned.

@jmarshallnz
Team Kodi member

We can't - it's a bugfix for an incorrect string, and it needs to be in this order.

@jmarshallnz
Team Kodi member

@alanwww1 please comment on this (i.e. changed string definition in strings.po -> what happens on Transifex?)

@alanwww1
Team Kodi member
alanwww1 added a note Apr 8, 2013

It is OK like this. This is one improvement we have with PO over the XML system is that we can re-use string IDs, it won't get misstranslated as the system checks both the msgctxt and msgid field to match a translation.

So this will appear as a completely new translatable string for all languages. the previous string gets cleared for all translations (but stay in the translation memory for future use)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@smfontes smfontes commented on the diff Mar 24, 2013
lib/libexif/IptcParse.cpp
@@ -56,7 +56,7 @@
#define IPTC_COUNTRY 0x65
#define IPTC_TRANSMISSION_REFERENCE 0x67
#define IPTC_DATE 0x37
-#define IPTC_COPYRIGHT 0x0A

0x0A is IPTC.Urgency

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@smfontes smfontes commented on an outdated diff Mar 24, 2013
xbmc/GUIInfoManager.cpp
@@ -474,6 +474,39 @@ int CGUIInfoManager::TranslateString(const CStdString &condition)
{ "picturegpslat", LISTITEM_PICTURE_GPS_LAT },
{ "picturegpslon", LISTITEM_PICTURE_GPS_LON },
{ "picturegpsalt", LISTITEM_PICTURE_GPS_ALT },
+ { "pictureauthor", LISTITEM_PICTURE_AUTHOR },

All of the metadata that was only available as slideshow.* INFO variables is now available as ListItem.Picture* INFO variables

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@smfontes smfontes commented on the diff Mar 24, 2013
xbmc/pictures/PictureInfoTag.cpp
@@ -128,6 +128,9 @@ void CPictureInfoTag::Archive(CArchive& ar)
ar << CStdString(m_iptcInfo.State);
ar << CStdString(m_iptcInfo.SupplementalCategories);
ar << CStdString(m_iptcInfo.TransmissionReference);
+ ar << CStdString(m_iptcInfo.TimeCreated);

Added the last three pieces of metadata that was retrieved from the file, but not made available.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@smfontes smfontes commented on the diff Mar 24, 2013
xbmc/pictures/PictureInfoTag.cpp
@@ -537,7 +560,7 @@ int CPictureInfoTag::TranslateString(const CStdString &info)
else if (info.Equals("cameramodel")) return SLIDE_EXIF_CAMERA_MODEL;
else if (info.Equals("exifcomment")) return SLIDE_EXIF_COMMENT;
else if (info.Equals("exifsoftware")) return SLIDE_EXIF_SOFTWARE;
- else if (info.Equals("apreture")) return SLIDE_EXIF_APERTURE;

Fixed spelling mistake

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@smfontes smfontes commented on the diff Mar 24, 2013
xbmc/pictures/PictureInfoTag.cpp
@@ -556,7 +579,7 @@ int CPictureInfoTag::TranslateString(const CStdString &info)
else if (info.Equals("keywords")) return SLIDE_IPTC_KEYWORDS;
else if (info.Equals("caption")) return SLIDE_IPTC_CAPTION;
else if (info.Equals("author")) return SLIDE_IPTC_AUTHOR;
- else if (info.Equals("healine")) return SLIDE_IPTC_HEADLINE;

Fixed spelling mistake

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@smfontes smfontes commented on the diff Mar 24, 2013
xbmc/pictures/PictureInfoTag.cpp
@@ -510,9 +519,23 @@ const CStdString CPictureInfoTag::GetInfo(int info) const
case SLIDE_IPTC_COUNTRY: value = m_iptcInfo.Country; break;
case SLIDE_IPTC_TX_REFERENCE: value = m_iptcInfo.TransmissionReference; break;
case SLIDE_IPTC_DATE: value = m_iptcInfo.Date; break;
- case SLIDE_IPTC_COPYRIGHT: value = m_iptcInfo.Copyright; break;
+ case SLIDE_IPTC_URGENCY:

IPTC Urgency is typically used for storing picture rating. Most urgent is 1, this equals 5 stars. Least urgent is 5, this equals 1 star. Urgency 6-9 are not used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@jmarshallnz
Team Kodi member

rebase please.

@smfontes

Rebased

@smfontes

I found one more incomplete bit of tag info to add. Slideshow INFO tags can return just the date with no time, I added that for ListItem.Picture* INFO as well, and add the ability to get long format date.

@jmarshallnz jmarshallnz merged commit 1e21f00 into xbmc:master Apr 8, 2013
@MartijnKaijser
Team Kodi member

@alanwww1
thx for clarifying that as i thought it wouldn't pick that up. Must have confused it with XML then

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment