How can I have a fallback for a special image?
#1
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?
Image
To learn more, click here.
Reply
#2
try if this works:

- add fallback="empty.png" to the first image
- use <visible>StringCompare(Control.GetLabel(8984),empty.png)</visible> on the second
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
#3
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.
Image
To learn more, click here.
Reply
#4
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?
Image
To learn more, click here.
Reply
#5
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.
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
#6
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.
Image
To learn more, click here.
Reply
#7
igotdvds Wrote:I copied and pasted and it doesnt work....this is strange.

are using it inside a list?
that probably won't work.
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
#8
ronie Wrote:are using it inside a list?
that probably won't work.

Yes in a list. So there is no workaround?
Image
To learn more, click here.
Reply
#9
igotdvds Wrote:Yes in a list. So there is no workaround?

not that i'm aware of...
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
#10
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.
Always read the XBMC online-manual, FAQ and search the forums before posting.
Do NOT e-mail Team-XBMC members asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting, make sure you read this first

My previous forum/trac nickname: grajen3
Reply
#11
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.
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
#12
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).
Always read the XBMC online-manual, FAQ and search the forums before posting.
Do NOT e-mail Team-XBMC members asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting, make sure you read this first

My previous forum/trac nickname: grajen3
Reply
#13
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
Reply
#14
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.
Image
To learn more, click here.
Reply
#15
Is there any way this could be added. I find lots of uses for being able to use a special image as a fallback.
Image
To learn more, click here.
Reply

Logout Mark Read Team Forum Stats Members Help
How can I have a fallback for a special image?0