Hi,
Building on what Rob has correctly described for other images like OpenViX and Beyonwiz there is a new issue looming. Now that we have 4K boxes it won't be long before we start to get 4K skins. (Not that I think they are necessary, but I also think that many FHD skins are also overkill. ) We need to pre-empt these issues and come up with a better way of handling appropriate resolution image location in skins.
Following on from Rob's example we need a way to find images not only in the current skin but also from a common library of skin elements. That is why on other images we look for the image path used in the skin within the current skin and then, if the image is not found, we look in the generic skin_default that also acts as a complete fall back skin if the selected skin can't load.
This was fine in the early days when there were only 720 resolution skins. Now that we have 1080 and 720 skins there is an issue with this simple search in that we may find images that are inappropriate the the current operating resolution. (This is a problem for VirtualKeyBoard to find the appropriate resolution images.) We need a way to select images that will match or be compatible with the operating skin at the current resolution. It would be preferred to find a way that will allow future expansion without requiring a massive rewrite of existing code and skins.
I propose that we extend the OpenViX etc model and enhance it to include an extra step that looks in a resolution appropriate library. Let us assume your skin is a FHD or 1920 x 1080 resolution. If so the search order should be, using Rob's example:
- Look in the current skin "/usr/share/enigma2/<skin>/infobar/ico_txt_on.png" (where "<skin>" is the name of the current skin).
- Look in the resolution appropriate library "/usr/share/enigma2/skin_1080/infobar/ico_txt_on.png" (where "skin_1080" is the proposed name for the 1920 x 1080 resolution images).
- Look in the fall back skin "/usr/share/enigma2/skin_default/infobar/ico_txt_on.png" (where "skin_default" is the fall back skin and the library of 1280 x 720 resolution images).
The first image that is found along the search path should be used. The "/usr/share/enigma2/skin_default" is and should remain a 1280 x 720 resolution skin to be a safe fall back for ALL boxes. The library image folders would follow the form of "/usr/share/enigma2/skin_<resolution>" where resolution could be 1080, 2160, 4320, etc. There is no need for a 720 directory as the existing "skin_default" would serve that purpose.
Having proposed the search protocol the next item is where should it be implemented. I think the natural location is in the evaluation of the "SCOPE_CURRENT_SKIN" value. This is a simple change that would allow all images to be able to fine tune the search algorithm to suit their specific needs WITHOUT requiring complicated changes to the Python and/or skin XML code.
To maximise legacy compatibility with existing OpenPLi skins the revised "SCOPE_CURRENT_SKIN" evaluation can look for any hard coded "skin_default/" image requests and strip this off the image path and then use the new search system to find the best / most appropriate image.
@Rob: Does this match your thoughts?
@Everyone: Does this explain why I coded VirtualKeyBoard in the way that I did? On OpenViX and Beyonwiz the images are found by the search and the skin developer is none the wiser.
This proposal does away with the ridiculously long image paths (/usr/share/enigma2/<skin>/skin_default/infobar/ico_txt_on.png" that currently infest OpenPLi skins. This proposal will also allow users the share skin image elements among skins reducing image duplication as raised earlier in this thread. The proposal is also future looking and will cope with current and future skin resolutions (1280 x 720, 1920 x 1080, 3840 x 2160, 7680 x 4320, etc)
Have I missed anything? Can anyone see any issues with my proposal? Should we give it a try?
Regards,
Ian.