PDA

View Full Version : Fallback Texture / Image?


skunkm0nkee
2008-05-23, 17:12
I have some code which is displaying a texture for items in a list, in the following manner:

<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:

<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

jmarshall
2008-05-24, 01:08
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.

skunkm0nkee
2008-05-24, 02:23
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?

Wir3d
2008-05-24, 04:34
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:

ccMatrix
2009-06-13, 19:06
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.

jmarshall
2009-06-14, 07:04
Add a ticket on trac describing the desired behaviour, and cc me.

ronie
2009-07-07, 16:04
for the record, this functionality has been added to xbmc:
http://xbmc.svn.sourceforge.net/viewvc/xbmc?view=rev&revision=21336

jmarshall
2009-07-08, 02:08
You're welcome - did I ever get a trac ticket btw?

Cheers,
Jonathan

jmarshall
2009-07-08, 02:08
You're welcome - did I ever get a trac ticket btw?

Cheers,
Jonathan

ccMatrix
2009-07-08, 02:21
You're welcome - did I ever get a trac ticket btw?

Cheers,
Jonathan

yes: http://xbmc.org/trac/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 :)

jmarshall
2009-07-08, 02:35
Thanks - now I can close it :)