Reply to topic  [ 4 posts ] 
Bundles as files 
Author Message
What's a life?
User avatar

Joined: Thu Apr 23, 2009 6:27 pm
Posts: 12251
Reply with quote
I’m tinkering with an idea in LIveCode (well worth looking at). It builds cross platform applications, and right now I’m making headway into a Stereo Card creation application. It works nicely, but the fly in the ointment at the moment is saving data. I can save a file with all the data necessary to rebuild the document when it’s reloading (yay me!), but the problem is if I save the images used, the file size balloons in a scary way. Two images should, as PNGs, occupy 20MB between them. In the saved data file, the images are stored as base64 data (necessary, apparently), and the file balloons to 140mb! Yikes.

So, to save space, I could easily drop the images as separate files, and the rest of the data into a text file which would then occupy a few K. This would have to happen in a folder, and on a Mac, I can turn a folder into a bundle which appears as a file to the OS. However, I don’t know if I can do this in Windows. Can I? What’s the file structure if I need to and (importantly, as this is a cross platform thing - LiveCode will output Windows and Mac versions from one file - I’ll need to dump a hybrid so both OSes can read them).

The fudge which crossed my mind (and I don‘t like it ) is to
1 - Create a folder, and put all files needed in it
2 - Zip the folder up & rename the .zip file with an extension that the application can be associated to
3 - Delete the folder
4 - Reverse process to load

Any ideas? I’m open to suggestions.

_________________
All the best,
Paul
brataccas wrote:
your posts are just combo chains of funny win

I’m on Twitter, tweeting away... My Photos Random Avatar Explanation


Sat Feb 06, 2016 10:56 pm
Profile
What's a life?
User avatar

Joined: Thu Apr 23, 2009 7:26 pm
Posts: 17040
Reply with quote
Do you need the 'create the folder/delete the folder' parts? Can't you create the zip in RAM and then just write the data to disk using whatever metadata/extension you like?


Sat Feb 06, 2016 11:24 pm
Profile
What's a life?
User avatar

Joined: Thu Apr 23, 2009 8:25 pm
Posts: 10691
Location: Bramsche
Reply with quote
Given that PNGs are already compressed, zipping probably wouldn't help. Can you turn up the compression on the PNGs?

_________________
"Do you know what this is? Hmm? No, I can see you do not. You have that vacant look in your eyes, which says hold my head to your ear, you will hear the sea!" - Londo Molari

Executive Producer No Agenda Show 246


Sun Feb 07, 2016 12:22 pm
Profile ICQ
What's a life?
User avatar

Joined: Thu Apr 23, 2009 6:27 pm
Posts: 12251
Reply with quote
The idea of using .zip as the file container was really to stop the user from moving stuff around and leaving files behind.

Anyway, the problem has been sidestepped. LiveCode allows you to create extra stacks on the fly, and save them as separate files, so I can throw all the data onto that temporary stack, save it, and reload later and pull the data back. The file size is a much more palatable 20mb - which is about right for the images I’m using.

_________________
All the best,
Paul
brataccas wrote:
your posts are just combo chains of funny win

I’m on Twitter, tweeting away... My Photos Random Avatar Explanation


Sun Feb 07, 2016 11:19 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 4 posts ] 

Who is online

Users browsing this forum: No registered users and 86 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software.