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
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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.