Thread: Compression methods for zip

  1. #1
    Registered User
    Join Date
    Dec 2016
    Posts
    96

    Compression methods for zip

    Hi guys!
    I am sorry for posting threads, but I think this is the right approach, instead of asking 2 questions in 1 thread.

    I have done ".jpeg" compression in C(DSP TigerShark processors), now I want to make a ".zip". The idea is to read a ".zip" file and uncompress it or to read a file and compress it.

    Can anyone give me the formula and some basic explanations about the method. Please do not redirect me to other forums, books and etc.

  2. #2
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    Since you don't want to be redirected, you presumably have done your research but are stumped for some reason. So, how are you stuck?
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  3. #3
    Registered User
    Join Date
    Dec 2016
    Posts
    96
    I just need the formula. I know what a compression is and how to apply it. Also if there is some special procedure for the ".zip" compression(tricks of the trade).

  4. #4
    Programming Wraith GReaper's Avatar
    Join Date
    Apr 2009
    Location
    Greece
    Posts
    2,738
    Just a formula wouldn't be enough. I hope you're fine with reading technical documentation, because what follows is the ZIP specification:
    https://pkware.cachefly.net/webdocs/...es/APPNOTE.TXT

    Have fun!...

    (Oh wow, I rhymed by accident )
    Devoted my life to programming...

  5. #5
    Registered User
    Join Date
    Dec 2016
    Posts
    96
    If I wanted to read the documentation, I wouldn't ask for just the formula. Everything is a formula in life, especially in C, and when we add the tricks of the trade, from 100000000 pages you get 1 page.

  6. #6
    Registered User
    Join Date
    Feb 2019
    Posts
    1,078
    zlib and RFC 1951 is what you are searching for...

  7. #7
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    Quote Originally Posted by ArakelTheDragon
    Everything is a formula in life, especially in C
    That's obviously false: while a particular formula might be essential to an algorithm, not all algorithms can be reduced to a formula, unless you're using a non-mathematical meaning of "formula" such that it is equivalent to "algorithm".

    Anyway, if you're not interested in reading the docs, why bother with implementing the algorithms yourself? A quick search of the Web shows that there are existing C libraries. Saves you the trouble of debugging too.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  8. #8
    Registered User
    Join Date
    Dec 2016
    Posts
    96
    Thanks to both of you! Yes I meant non-mathematical meaning. I will look it up, but my searches until now were not successfull.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. better compression alg
    By Yarin in forum A Brief History of Cprogramming.com
    Replies: 1
    Last Post: 12-06-2008, 04:53 PM
  2. Can you inherit Methods into other methods?
    By bobbelPoP in forum C++ Programming
    Replies: 5
    Last Post: 08-02-2008, 08:32 AM
  3. Compression
    By ~Kyo~ in forum Game Programming
    Replies: 9
    Last Post: 10-24-2004, 12:41 AM
  4. DIB compression
    By SAMSAM in forum Windows Programming
    Replies: 2
    Last Post: 01-26-2003, 02:40 PM
  5. compression
    By jobolikescake in forum C++ Programming
    Replies: 10
    Last Post: 10-31-2002, 12:38 PM

Tags for this Thread