Transparent ZIP Support For Storing Skins (1 Viewer)

c.hilding

Portal Member
November 17, 2006
40
0
ABANDONED ACCOUNT
Home Country
Transparent ZIP support for skin storage can be implemented by using a wrapper function that is called instead of reading directly from the skin directory. I.e. an "fopen('./skins/bw2/back.jpg')" would be "skinwrapper('bw2', 'back.jpg')".

This approach has been proven effective by endless other projects. And it doesn't consume much CPU as it only reads the zip file index and then gets that specific file, without reading the whole ZIP file into RAM. As for a slowdown in access times, it is negligible and ultimately unnoticeable since it is possible to perform decompression transparently if you're using a good implementation.

This feature has many benefits, from leveraging file system abuse (each skin houses about 750 files), to bringing down the whole skin size by 10-80%.
 

c.hilding

Portal Member
November 17, 2006
40
0
ABANDONED ACCOUNT
Home Country
NTFS File Compression is a great example of how transparent the process can be. The files are compressed on the disk and as soon as you access them they are instantly decompressed with no noticeable slowdown.
 

wertzui

Retired Team Member
  • Premium Supporter
  • July 2, 2005
    320
    8
    as a skinner, i would highly dislike this.
    i dont want to recreate a zipfile, everytime i make a little shange to a skin.
    and i think if you can spare some megs for timeshift, you could spare some for a skin too.
     

    Crim

    Portal Member
    April 13, 2006
    10
    0
    as a skinner, i would highly dislike this.
    i dont want to recreate a zipfile, everytime i make a little shange to a skin.
    and i think if you can spare some megs for timeshift, you could spare some for a skin too.
    I think the point of it is that it's a more elegant way of organising skins. I've made some skins for Firefox (which would be much the same thing as using a zip) and it's not a pain like you're saying. It's actually rather nice; you don't need to make a zipfile each time you change something either. just open up the skin zip with your zip app and drag and drop the changed file in the right folder. Your zip app should replace it with the new version all without having to make another zip file.

    I think it's a great idea.
     

    and-81

    Retired Team Member
  • Premium Supporter
  • March 7, 2005
    2,257
    183
    Melbourne
    Home Country
    Australia Australia
    Given that our skins consist of so many small files, this might actually speed up the loading of skin elements...

    Instead of having many small files spread out on the hard disk (even defragmented the individual files may not be contiguous on the platter) you would have one file that theoretically would be quicker to access.

    If it speeds things up and doesn't introduce any significant complication for skinners then I guess it should go in. If it doesn't make a quantifiable difference to skin loading times then we leave it out. But we won't know until we try ...

    I can't see this as being a difficult change to make, does someone want to make a proof of concept?

    Cheers,
     

    tourettes

    Retired Team Member
  • Premium Supporter
  • January 7, 2005
    17,301
    4,800
    Would it be possible to support both and therefore skin devs could work with the current solution and use the zip system for MP release versions.

    That would be a good option. As it would not cause any trouble for skinners and when the skin is ready to be relased skinner could just zip it and user would be able to use the zip as easily as current architecture.
     

    and-81

    Retired Team Member
  • Premium Supporter
  • March 7, 2005
    2,257
    183
    Melbourne
    Home Country
    Australia Australia
    It would have to support both at the same time.

    Basically, it would need to load from the zip file, but also from the folders. This would let plugins add to or modify files in the skins folder as well.

    The code should favour files outside the zip file over files inside the zip.
     

    Users who are viewing this thread

    Top Bottom