PDA

View Full Version : [bug?] fallback image


CF2009
2009-04-07, 18:20
it look like there is a bug with fallback image it only works if there is no String (image address) to look for ???

IE.
not working

<control type="image">
<texture fallback="defaultfolderbig.png">$INFO[ListItem.Label,,.jpg]</texture>
</control>


working

<control type="image">
<texture fallback="defaultfolderbig.png">$INFO[Skin.String(Empty)]</texture>
</control>

is there any way we can have it look to see if the image file is there if not then use the fallback image?

jmarshall
2009-04-08, 07:55
Nope, the skin does not hit the filesystem to check file existence, and nor should it.

CF2009
2009-04-08, 13:37
k is there any other way to have a fallback image other then having a image control in the background?

skunkm0nkee
2009-04-08, 17:34
I don't think there's any way the skin can test whether an image exists or not if that is what you are asking.

If you want an image to appear if a certain image file doesn't exist then you probably do need to place your fallback image behind it.

You might want to do a test on the image control's IsVisible property cos I'm not sure what the result is if the image file is not found? (My guess is that it's still visible, just that it doesn't actually have an image file to display but yo never know)

Nuka1195
2009-04-08, 19:14
that may be useful. if the image does not exist have xbmc set the control to invisible.

if the OP is using transparent images. the one behind would show thru.

jmarshall
2009-04-09, 00:18
Getting it to return false to a visibility condition could be problematic. Primarily as we don't necessarily know whether or not the image can be loaded at certain points (eg large image loading) and the setting of which image to load occurs at render time, and hence one might get visibility returning false at some point in the render cycle and true at others (causing glitches).

In my opinion, the best plan of attack is to decide what should be done when we're unable to load an image. This is a feature request really, so obviously nothing that can be done until after Babylon.

Skinners should consider possible implications of a failure to load an image dropping back to the fallback, or whether it should drop back to nothing. If necessary we can add a switch, though I'd prefer not to.

Cheers,
Jonathan