Converting skins to 1920x1080

  Thread Rating:
  • 1 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
wyrm Offline
Skilled Skinner
Posts: 766
Joined: Nov 2007
Reputation: 5
Location: Perth, Australia (GMT +8)
Post: #21
phil65 Wrote:Ok, here it is Smile
http://www.gtwf-koeln.de/xmlconvertgui.exe
Please report bugs, missing tags etc...
feedback is always welcome.

current limiitations:
does net convert <posx>400r</posx> for example
no conversion of attributes (for example for animation and border tags)
seems to hang when adding a lot of files... just wait a bit

made some changes some minutes ago, i hope everything works ok.

If someone wants to have the project files, just ask.
phil65,

I had someone write me a perl script that did something similar, but only looked after height, width, posx and posy. Only downside I can see with what you have (other than being windows only) is that the fixed conversion factors. If you allowed the user to input them, this could be used to convert from one resolution to any other (ie 720p to iPad native).

Just a thought.
Wyrm (xTV-SAF)
find quote
phil65 Offline
Skilled Skinner
Posts: 4,456
Joined: Mar 2009
Reputation: 56
Location: Cologne, Germany
Post: #22
wyrm Wrote:phil65,

I had someone write me a perl script that did something similar, but only looked after height, width, posx and posy. Only downside I can see with what you have (other than being windows only) is that the fixed conversion factors. If you allowed the user to input them, this could be used to convert from one resolution to any other (ie 720p to iPad native).

Just a thought.
Wyrm (xTV-SAF)

would take one minute to change that Smile if someone wants it i could do that.
find quote
Maxoo Offline
Fan
Posts: 329
Joined: Mar 2010
Reputation: 11
Location: Paris, France
Post: #23
iPad isn't 16:9, is it ?

Admin @ Passion-XBMC
(official french community)
find quote
phil65 Offline
Skilled Skinner
Posts: 4,456
Joined: Mar 2009
Reputation: 56
Location: Cologne, Germany
Post: #24
Maxoo Wrote:iPad isn't 16:9, is it ?

i also think that the 16:9 skins are scaled to Retina display ratio by XBMC, so no need to adjust the skins.

EDIT: updated the .exe, should convert <posx>400r</posx> properly now Smile (removing r --> scaling --> adding r)
find quote
wyrm Offline
Skilled Skinner
Posts: 766
Joined: Nov 2007
Reputation: 5
Location: Perth, Australia (GMT +8)
Post: #25
phil65 Wrote:i also think that the 16:9 skins are scaled to Retina display ratio by XBMC, so no need to adjust the skins.

phil65,

XBMC will convert to any resolution really. Point was more that you be able to produce a skin that was coded to your target devices native res. Resulting skin would still run fine on any XBMC device, just that you could use your utility to fine tune for particular target. Touched runs just fine on most platforms, it's just targeted at the iPad.

Wyrm (xTV-SAF)
find quote
phil65 Offline
Skilled Skinner
Posts: 4,456
Joined: Mar 2009
Reputation: 56
Location: Cologne, Germany
Post: #26
wyrm Wrote:phil65,

XBMC will convert to any resolution really. Point was more that you be able to produce a skin that was coded to your target devices native res. Resulting skin would still run fine on any XBMC device, just that you could use your utility to fine tune for particular target. Touched runs just fine on most platforms, it's just targeted at the iPad.

Wyrm (xTV-SAF)

so you want seperate x and y scaling? could be implemented easily, if someone really wants to use it.
find quote
wyrm Offline
Skilled Skinner
Posts: 766
Joined: Nov 2007
Reputation: 5
Location: Perth, Australia (GMT +8)
Post: #27
phil65 Wrote:so you want seperate x and y scaling? could be implemented easily, if someone really wants to use it.
I know it could get a work out on the constantly threatened "Slab" project of mine.

Wyrm (xTV-SAF)
find quote
Sinnocence Offline
Member+
Posts: 97
Joined: Oct 2007
Reputation: 4
Post: #28
I took a sample skin XML file from google for XBMC and put together a quick XSL based on the rules in the above VB source code. You may need to do a bit of work to get it perfect for you...

Matches the specified element list and for each replaces their value with the previous value * 1.5, rounded up/down as appropriate.

[edit] This didn't satsfy all values, see Post #37 for an updated copy [/edit]

Code:
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:output method="xml" indents="yes"/>

<xsl:variable name="MULTIPLIER">1.5</xsl:variable>

  <!-- template (copies input file as-is) -->
  <xsl:template match="@*|node()">
    <xsl:copy>
      <xsl:apply-templates select="@*|node()"/>
    </xsl:copy>
  </xsl:template>

  <!-- specific overrides -->
  <xsl:template match="posx|posy|width|height|textoffsetx|textoffsety|radiowidth|radioheight|radioposx|​radioposy|textwidth|border">
    <xsl:element name="{local-name()}">
      <xsl:value-of select="round(number(.) * number($MULTIPLIER))"/>
    </xsl:element>
  </xsl:template>

</xsl:stylesheet>
(This post was last modified: 2012-03-10 18:29 by Sinnocence.)
find quote
spiff Offline
Grumpy Bastard Developer
Posts: 12,180
Joined: Nov 2003
Reputation: 82
Post: #29
nice. for linux users,
Code:
for file in *xml; do xsltproc ~/foo.xslt "$file" > foo && mv foo "$file"; done
will transform all xmls in the current directory, assuming the xslt from the previous post is available as ~/foo.xslt

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.
find quote
phil65 Offline
Skilled Skinner
Posts: 4,456
Joined: Mar 2009
Reputation: 56
Location: Cologne, Germany
Post: #30
Sinnocence Wrote:I took a sample skin XML file from google for XBMC and put together a quick XSL based on the rules in the above VB source code. You may need to do a bit of work to get it perfect for you...

Matches the specified element list and for each replaces their value with the previous value * 1.5, rounded up/down as appropriate.

Code:
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:output method="xml" indents="yes"/>

<xsl:variable name="MULTIPLIER">1.5</xsl:variable>

  <!-- template (copies input file as-is) -->
  <xsl:template match="@*|node()">
    <xsl:copy>
      <xsl:apply-templates select="@*|node()"/>
    </xsl:copy>
  </xsl:template>

  <!-- specific overrides -->
  <xsl:template match="posx|posy|width|height|textoffsetx|textoffsety|radiowidth|radioheight|radioposx|​radioposy|textwidth|border">
    <xsl:element name="{local-name()}">
      <xsl:value-of select="round(number(.) * number($MULTIPLIER))"/>
    </xsl:element>
  </xsl:template>

</xsl:stylesheet>

spiff Wrote:nice. for linux users,
Code:
for file in *xml; do xsltproc ~/foo.xslt "$file" > foo && mv foo "$file"; done
will transform all xmls in the current directory, assuming the xslt from the previous post is available as ~/foo.xslt

nice. will try to implement changing the attributes now.
find quote
Post Reply