codingmasterRS Posted August 12, 2010 Share Posted August 12, 2010 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. Quote Link to comment Share on other sites More sharing options...
codingmasterRS Posted August 12, 2010 Author Share Posted August 12, 2010 any suggestions are welcome Quote Link to comment Share on other sites More sharing options...
AbraCadaver Posted August 12, 2010 Share Posted August 12, 2010 http://us3.php.net/manual/en/refs.compression.php As for the requirements, you'll need to test on some of your files as many images, videos and music files are already compressed in some fashion. Quote Link to comment Share on other sites More sharing options...
codingmasterRS Posted August 12, 2010 Author Share Posted August 12, 2010 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? Quote Link to comment Share on other sites More sharing options...
AbraCadaver Posted August 12, 2010 Share Posted August 12, 2010 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. Quote Link to comment Share on other sites More sharing options...
codingmasterRS Posted August 12, 2010 Author Share Posted August 12, 2010 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? Quote Link to comment Share on other sites More sharing options...
codingmasterRS Posted August 13, 2010 Author Share Posted August 13, 2010 opinions? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.