Kodi Community Forum
multiimage question - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32)
+--- Forum: Skinning (https://forum.kodi.tv/forumdisplay.php?fid=12)
+--- Thread: multiimage question (/showthread.php?tid=140405)

Pages: 1 2


multiimage question - adrian ballard - 2012-09-13

Brain isn't working and I can't seem to locate an answer by searching.......

If I've got a multiimage command, how do I verify that the imagepath has images and if not would fallback to $INFO[ListItem.Property(Fanart_Image)]?

Probably easy but I'm not seeing the solution.


RE: multiimage question - Jezz_X - 2012-09-13

don't think you can


RE: multiimage question - phil65 - 2012-09-13

this works I think, but only outside of containers:

give multiimage control (here in this example showin extrafanart) an id and then for the fanart
<visible>!SubString(Control.getLabel(8870),extrafanart)</visible>



RE: multiimage question - adrian ballard - 2012-09-13

kinda like this?

Code:
<control type="image" description="fanart">
    <visible>!Control.IsVisible(987654)</visible>
    <texture background="true">$INFO[ListItem.Property(Fanart_Image)]</texture>
</control>
<control type="multiimage" id="987654" description="fanart">
    <imagepath background="true">$INFO[ListItem.Path,,extrafanart]</imagepath>
</control>

Works just fine except for 1 issue:
How to test that <imagepath background="true">$INFO[ListItem.Path,,extrafanart]</imagepath> actually has images?


RE: multiimage question - MassIV - 2012-09-13

Maybe if you can check for the existence of the file extension? With something like:
condition="SubString(ListItem.FileExtension,png)"


RE: multiimage question - adrian ballard - 2012-09-16

OK, I've gone round and round with this for a couple of days now and it's driving me nuts!!
I've yet to find a good solution to a very simple problem:
If I define a multiimage, how to check if the folder exists and/or that it contains images?

What we need is something like:
<visible>IsEmpty(imagepath)</visible>
Where imagepath is not the actual path string but if the folder has ANYTHING in it.

Yes, there's a workaround to a point but it's not a true evaluation of the condition and prevents the skin from being really smooth.
ie: I place a fallback image under the multiimage- works BUT introduce a fade and the underlying image becomes visible for a split second as the images change.

So, is it at all possible to add this in?
If not, how about being able to define a fallback? That would work just as well.

Could someone point me in a direction to achieve this?
Sorry but I'm a perfectionist and like I said, it's really bugging me.
Please and thank you.....

PS: I'm much more bald than I was a few days ago...


RE: multiimage question - phil65 - 2012-09-16

(2012-09-16, 03:34)adrian ballard Wrote: OK, I've gone round and round with this for a couple of days now and it's driving me nuts!!
I've yet to find a good solution to a very simple problem:
If I define a multiimage, how to check if the folder exists and/or that it contains images?

What we need is something like:
<visible>IsEmpty(imagepath)</visible>
Where imagepath is not the actual path string but if the folder has ANYTHING in it.

Yes, there's a workaround to a point but it's not a true evaluation of the condition and prevents the skin from being really smooth.
ie: I place a fallback image under the multiimage- works BUT introduce a fade and the underlying image becomes visible for a split second as the images change.

So, is it at all possible to add this in?
If not, how about being able to define a fallback? That would work just as well.

Could someone point me in a direction to achieve this?
Sorry but I'm a perfectionist and like I said, it's really bugging me.
Please and thank you.....

PS: I'm much more bald than I was a few days ago...

it just isnĀ“t possible in a really nice way atm.



RE: multiimage question - adrian ballard - 2012-09-16

Fair enough.
If we could just get it on the radar I'd be happy with that.

TBH: I can't believe this hasn't come up before as visual appeal is just as important as functionality.
my 0.02


Re: multiimage question - Jezz_X - 2012-09-16

the reason is not in and it has been discussed many times is too do with the way that info labels work in xbmc. Basically the are polled every frame and checked. And doing file system checks sixty times a second is not a great idea there had been discussion on how too change it but no one had really stepped up to code it in as its a huge under lying change to everything


RE: multiimage question - jmarshall - 2012-09-17

One thing that might be doable is to reset the path (i.e. so that control.getlabel returns empty) if the directory load fails. I don't have time to look at it though (the same could be done for images - can't recall offhand if it does it or not).


RE: multiimage question - pieh - 2012-09-17

@jmarshall
control.getlabel will return path to current image, so if there are no image it will stay empty. I think problem here is that there is no way to determine if we are past directory loading or not as before/after directory loading control.getlabel will stay empty. So using <visible>!IsEmpty(Control.GetLabel(multiimage_id))</visible> for fallback image is not accurate as it will show control before loading dir.


RE: multiimage question - jmarshall - 2012-09-18

All they need to know is if the multi image has anything in it, right?


RE: multiimage question - adrian ballard - 2012-09-18

yes, at the very least, please.

so that this
<visible>!IsEmpty(Control.GetLabel(multiimage_id))</visible>
will work correctly


RE: multiimage question - pieh - 2012-09-19

(2012-09-18, 16:54)adrian ballard Wrote: yes, at the very least, please.

so that this
<visible>!IsEmpty(Control.GetLabel(multiimage_id))</visible>
will work correctly
it works http://trac.xbmc.org/ticket/10069 - if not explain what exactly doesn't work


RE: multiimage question - adrian ballard - 2012-09-20

Example 1: This won't work as my understanding is the fallback image must be a fixed image.
Code:
<control type="multiimage">
    <posx>0</posx>
    <posy>0</posy>
    <width>1920</width>
    <height>1080</height>
    <aspectratio>stretch</aspectratio>
    <randomize>true</randomize>
    <timeperimage>5000</timeperimage>
    <fadetime>250</fadetime>
    <imagepath background="true" fallback="$INFO[ListItem.Property(Fanart_Image)]">$INFO[ListItem.Path,,/extrafanart/]</imagepath>
</control>

Example 2: (999999) should only be visible if the extrafanart folder for (987654) is empty. Instead, (999999) is always visible whether the extrafanart folder for (987654) is empty or not.
Code:
<control type="multiimage" id="987654">
    <posx>0</posx>
    <posy>0</posy>
    <width>1920</width>
    <height>1080</height>
    <aspectratio>stretch</aspectratio>
    <randomize>true</randomize>
    <timeperimage>5000</timeperimage>
    <fadetime>250</fadetime>
    <imagepath background="true">$INFO[ListItem.Path,,/extrafanart/]</imagepath>
</control>
<control type="image" id="999999">
    <visible>IsEmpty(Control.GetLabel(987654))</visible>
    <posx>500</posx>
    <posy>0</posy>
    <width>1920</width>
    <height>1080</height>
    <aspectratio>stretch</aspectratio>
    <fadetime>250</fadetime>
    <texture>$INFO[ListItem.Property(Fanart_Image)]</texture>
</control>

Example 3: Using the above code but change IsEmpty to !IsEmpty.
Now (999999) is never visible even if the extrafanart folder for (987654) has something in it.

Note: I'm not using this for the home page. Trying to get this working properly from the movie list view.