Page 1 of 1
PHP File Packager
Posted: Thu Aug 05, 2004 1:38 am
by LiquidPro
I was thinking of a way to go about compressing and decompressing files with a PHP script. You'd simply upload your script to the webserver, it'd automatically unpackage them to a temporary place (filesystem or database). Then it would delete them when you were done using them.
This was my original thought:
a pattern 10 characters long could be compressed down to 6 characters. This would reduce the size of the file by almost half (40% smaller). Then I realized that would cause problems with the program confusing certain data with other data...
Anyone have any idea of a compression algorithm to use?
Note: This post was probably confusing as hell... sorry
Posted: Thu Aug 05, 2004 1:44 am
by feyd
I'd say, you might want to check out this book: Data Compression (ISBN 0-387-95045-1) by David Salomon. It's got some really great stuffs on differing algorithms for differing goals in compression.
Posted: Thu Aug 05, 2004 1:49 am
by LiquidPro
Well... if I had the money to buy myself a book on it, I would... but I don't exactly.
Maybe I can find an eBook version of it somewhere.
Posted: Thu Aug 05, 2004 1:50 am
by markl999
Posted: Thu Aug 05, 2004 1:59 am
by LiquidPro
I don't think you guys get me exactly... I'm wanting to create my own compression algorithm. I don't want to use an Open Source one or anything like that.
This is mostly just to create a crazy compression. I have one idea, which will be good and bad. If you have an extremely small file (3 characters) your package will end up being bigger. However, if you have a really big file, you will end up reducing the size by at least 50%
Posted: Thu Aug 05, 2004 2:00 am
by d3ad1ysp0rk
This is mostly just to create a crazy compression. I have one idea, which will be good and bad. If you have an extremely small file (3 characters) your package will end up being bigger. However, if you have a really big file, you will end up reducing the size by at least 50%
Check filesize before compression. If the file is already small enough, don't compress it.

Posted: Thu Aug 05, 2004 2:04 am
by feyd
You can check the newsgroups of comp.compression or something like that, can't remember exactly.. but there are lots of people and articles about the schemes behind differing forms and applications of compression algorithms.
Posted: Thu Aug 05, 2004 2:04 am
by LiquidPro
Very good solution!
I'll have to figure out the break even point, where compressing it doesn't do anything for it. If it's less than the break even point it won't compress it, if it's greater than it will!
Awesome idea, good thinking.