Kodi Community Forum

Full Version: Fallback Texture / Image?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I have some code which is displaying a texture for items in a list, in the following manner:

Code:
<texture>$INFO[ListItem.Label,,_icon.png]</texture>

What I would like is that if the texture does not find a relevant image then it could load a fallback image. Jezz mentioned to me in passing that fallback attribute of the texture tag may work but I tried the following without success:

Code:
<texture fallback="Default_icon.png">$INFO[ListItem.Label,,_icon.png]</texture>

Is something like this already available in XBMC and if so how? If it isn't available would it be possible at some point?

Thanks
It loads the fallback texture only if the infolabel returns empty. It doesn't attempt to load the fallback if it can't find the texture.

I'm not sure whether it should or shouldn't to be honest - I can see arguments for both sides.
You can test for when the info is empty via the IsEmpty but there isn't a way to test if the texture exists or not is there?
skunkm0nkee Wrote:You can test for when the info is empty via the IsEmpty but there isn't a way to test if the texture exists or not is there?

I think that would cover any side of the argument Nod
jmarshall Wrote:It loads the fallback texture only if the infolabel returns empty. It doesn't attempt to load the fallback if it can't find the texture.

I'm not sure whether it should or shouldn't to be honest - I can see arguments for both sides.

I was trying to use a fallback if the texture file isn't available for the codec/studio stuff. Is there currently any way to handle this?

I think it would be useful if fallback does trigger if the file doesn't exist. If the information is just empty, then this can be handled by a isEmpty() visible condition.
Add a ticket on trac describing the desired behaviour, and cc me.
for the record, this functionality has been added to xbmc:
http://xbmc.svn.sourceforge.net/viewvc/x...sion=21336
You're welcome - did I ever get a trac ticket btw?

Cheers,
Jonathan
You're welcome - did I ever get a trac ticket btw?

Cheers,
Jonathan
jmarshall Wrote:You're welcome - did I ever get a trac ticket btw?

Cheers,
Jonathan

yes: http://trac.xbmc.org/ticket/6776

And thank you very much for implementing it. Using it for TV show studio which falls back to generic HDTV/SDTV images if <studio>.png or <studio>_hd.png doesn't exist. Really nice Smile
Thanks - now I can close it Smile