Kodi Community Forum

Full Version: How can I have a fallback for a special image?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I want to show the logo.png if character.png isnt found.

I currently have:

Code:
                        <control type="largeimage" id="8984">
                            <posx>0</posx>
                            <posy>0</posy>
                            <width>300</width>
                            <height>300</height>
                            <aligny>center</aligny>
                            <texture background="true">$INFO[ListItem.Path,,character.png]</texture>
                            <aspectratio>keep</aspectratio>
                            <animation effect="fade" start="100" end="40" time="0" condition="Control.HasFocus(567)">conditional</animation>
                            <animation effect="fade" start="100" end="40" time="0" condition="!Control.HasFocus(567)">conditional</animation>
                            <visible>!stringcompare(ListItem.Icon,DefaultFolderBack.png)</visible>
                        </control>
                        <control type="largeimage">
                            <posx>0</posx>
                            <posy>50</posy>
                            <width>310</width>
                            <height>145</height>
                            <aligny>center</aligny>
                            <texture background="true">$INFO[ListItem.Path,,logo.png]</texture>
                            <aspectratio>keep</aspectratio>
                            <animation effect="fade" start="100" end="40" time="0" condition="Control.HasFocus(567)">conditional</animation>
                            <animation effect="fade" start="100" end="40" time="0" condition="!Control.HasFocus(567)">conditional</animation>
                            <visible>IsEmpty(Control.GetLabel(8984))</visible>
                            <visible>!stringcompare(ListItem.Icon,DefaultFolderBack.png)</visible>
                        </control>


But that doesnt work.

I also tried:

Code:
<visible>IsEmpty($INFO[ListItem.path]character.png)</visible>

That doesnt work. Anyone?
try if this works:

- add fallback="empty.png" to the first image
- use <visible>StringCompare(Control.GetLabel(8984),empty.png)</visible> on the second
ronie Wrote:try if this works:

- add fallback="empty.png" to the first image
- use <visible>StringCompare(Control.GetLabel(8984),empty.png)</visible> on the second

I like your style, I didnt think of that. I'll have to wait until I get home to try it out. I'll let you know. Thanks man.
ronie Wrote:try if this works:

- add fallback="empty.png" to the first image
- use <visible>StringCompare(Control.GetLabel(8984),empty.png)</visible> on the second

Nope, sadly it didnt work. Any other ideas?
igotdvds Wrote:Nope, sadly it didnt work. Any other ideas?

this works 100% for me:
Code:
<control type="image" id="8984">
    <posx>0</posx>
    <posy>50</posy>
    <width>310</width>
    <height>145</height>
    <aligny>center</aligny>
    <texture fallback="empty.png">$INFO[ListItem.Path,,character.png]</texture>
</control>
<control type="image">
    <posx>0</posx>
    <posy>50</posy>
    <width>310</width>
    <height>145</height>
    <aligny>center</aligny>
    <texture>$INFO[ListItem.Path,,logo.png]</texture>
    <visible>StringCompare(Control.GetLabel(8984),empty.png)</visible>
</control>


if i add background="true", i'm getting some weird behaviour,
the character image of the previous item seems to "stick" when the current item doesn't have one.
ronie Wrote:this works 100% for me:
Code:
<control type="image" id="8984">
    <posx>0</posx>
    <posy>50</posy>
    <width>310</width>
    <height>145</height>
    <aligny>center</aligny>
    <texture fallback="empty.png">$INFO[ListItem.Path,,character.png]</texture>
</control>
<control type="image">
    <posx>0</posx>
    <posy>50</posy>
    <width>310</width>
    <height>145</height>
    <aligny>center</aligny>
    <texture>$INFO[ListItem.Path,,logo.png]</texture>
    <visible>StringCompare(Control.GetLabel(8984),empty.png)</visible>
</control>


if i add background="true", i'm getting some weird behaviour,
the character image of the previous item seems to "stick" when the current item doesn't have one.

I copied and pasted and it doesnt work....this is strange.
igotdvds Wrote:I copied and pasted and it doesnt work....this is strange.

are using it inside a list?
that probably won't work.
ronie Wrote:are using it inside a list?
that probably won't work.

Yes in a list. So there is no workaround?
igotdvds Wrote:Yes in a list. So there is no workaround?

not that i'm aware of...
Such thing can't work in list - every listitem will have this image control and this mean that id=8984 is non-unique and can't be used to access any info. I don't think we currently can do something about it but we can add some support to handle such cases better - ideas welcomed.
pieh Wrote:Such thing can't work in list - every listitem will have this image control and this mean that id=8984 is non-unique and can't be used to access any info. I don't think we currently can do something about it but we can add some support to handle such cases better - ideas welcomed.

just thinking out loud (mind, i just woke up and only had one coffee):

allow skinners to define custom infolabel properties:
Code:
<infolabel propertyname="Banner">banner.jpg</infolabel>
<infolabel propertyname="Poster">poster.jpg</infolabel>
<infolabel propertyname="ClearArt">clearart.png</infolabel>
<infolabel propertyname="CharacterArt">character.png</infolabel>

which could be used as such:

Code:
<control type="image">
    <posx>0</posx>
    <posy>50</posy>
    <width>310</width>
    <height>145</height>
    <texture>$INFO[ListItem.Property(CharacterArt)]</texture>
</control>
<control type="image">
    <posx>0</posx>
    <posy>50</posy>
    <width>310</width>
    <height>145</height>
    <texture>$INFO[ListItem.Property(ClearArt)]</texture>
    <visible>IsEmpty(ListItem.Property(CharacterArt))</visible>
</control>


this would also solve the problem for allowing both banners and posters to be used for tv shows
and is easily expandable for any future types of custom images someone may come up with.
I think we should have deeper integration for these "custom" type of artwork - cache them and stick to proper entry in library (f.e. cleartart / logo should be sticked to tvshow and not seasons / episodes).

I don't use them myself, but I find it particulary annoying when I show a friend some nice skins using them (cause it cause my network attached drive to wake up to read logo or clearart when I just browse through library).
pieh Wrote:I think we should have deeper integration for these "custom" type of artwork - cache them and stick to proper entry in library (f.e. cleartart / logo should be sticked to tvshow and not seasons / episodes).

I don't use them myself, but I find it particulary annoying when I show a friend some nice skins using them (cause it cause my network attached drive to wake up to read logo or clearart when I just browse through library).

Multiple thumb support Wink
Well thats sad. Sad

Looks like I will just have a character fallback if no characters can be found.

I'll stay on top of this thread if anything changes.
Is there any way this could be added. I find lots of uses for being able to use a special image as a fallback.
Pages: 1 2