Jump to content

[SOLVED] File compression


Wolphie

Recommended Posts

Ok well i'm working on a project and it involves file uploading.

I've decided to upload the files to a BLOB field in a database, but to save valuable space i will have to compress it on upload.

My main question is what would be the best compression method (Stability and compression size)

And what are the functions to compress the file before uploading, and decompressing a file.

 

e.g. if somebody was to upload an image, it would be compressed...written to the database, and when somebody wanted to view it......call it from the database, decompress it and display it. (Same with video media and music)

Link to comment
https://forums.phpfreaks.com/topic/84022-solved-file-compression/
Share on other sites

The problem with what your asking is that media files are already compressed. The only way to compress them further is by using a better algorithm, or reducing quality.

 

For example a 800x800 bmp is a lot bigger than 800x800 jpeg.

 

But there is no good way to compress a 640x320 mpeg anymore without shrinking it, or using excessive cpu cycles. I mean A LOT of cpu time would be required, simply to save 100kb of space.

 

edit: gzip would be fine for text files, but its not worth it to use on media files.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.