View unanswered posts | View active topics
It is currently Wed Jun 05, 2024 6:35 pm
|
Page 1 of 1
|
[ 4 posts ] |
|
Author |
Message |
paulzolo
What's a life?
Joined: Thu Apr 23, 2009 6:27 pm Posts: 12251
|
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.
|
Sat Feb 06, 2016 10:56 pm |
|
|
jonbwfc
What's a life?
Joined: Thu Apr 23, 2009 7:26 pm Posts: 17040
|
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 |
|
|
big_D
What's a life?
Joined: Thu Apr 23, 2009 8:25 pm Posts: 10691 Location: Bramsche
|
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 |
|
|
paulzolo
What's a life?
Joined: Thu Apr 23, 2009 6:27 pm Posts: 12251
|
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.
|
Sun Feb 07, 2016 11:19 pm |
|
|
|
Page 1 of 1
|
[ 4 posts ] |
|
Who is online |
Users browsing this forum: No registered users and 14 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
|
|