Jump to content

Compression of different file formats


codingmasterRS

Recommended Posts

I am looking at using PHP (or whatever) to compress images/video/music when it is uploaded to be stored on the server and decompressed when required on the webpage. I know I will have to make a decompress function so it knows when to decompress to its full size, but any ideas on how to do the compression.

 

Requirements: biggest, best and efficient compression of music/image/video files.

 

 

Thanks in advance.

Link to comment
Share on other sites

so before it uploads it would do it to the file, how would you get it to do it to the file and not the file name before it saved it to the server and what are the compression rates (% of original size) for what you listed please?

You can't compress before the upload with PHP.  The compression rates are roughly the same for the listed compressions, but it will depend on the file itself.  I just tested on a 1MB PNG image and zip and gzip were the same but only saved 3 KB and bz2 saved 11 KB.  As I said, many of the types of files that you listed are already compressed to some extent and you may not see much improvement by compressing them again.

Link to comment
Share on other sites

There will be a large amount of videos/images stored so I need a good way of compressing them to reduce space. I also have been told I should automatically scale the images to what the biggest would be on the site possible and also reduce all to JPG and then to 70% quality? Opinions?

 

Thanks for the help so far AbraCadaver, PS could you supply the code you tested with?

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.