{"id":18365391,"url":"https://github.com/le0pard/zopfli-ffi","last_synced_at":"2025-04-06T16:31:28.119Z","repository":{"id":19767251,"uuid":"23025205","full_name":"le0pard/zopfli-ffi","owner":"le0pard","description":"Ruby wrapper for zopfli","archived":false,"fork":false,"pushed_at":"2019-03-21T16:14:25.000Z","size":49,"stargazers_count":10,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-04-14T15:50:36.195Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://leopard.in.ua/zopfli-ffi","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/le0pard.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-08-16T19:16:49.000Z","updated_at":"2021-12-20T02:17:46.000Z","dependencies_parsed_at":"2022-08-25T01:31:20.975Z","dependency_job_id":null,"html_url":"https://github.com/le0pard/zopfli-ffi","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/le0pard%2Fzopfli-ffi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/le0pard%2Fzopfli-ffi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/le0pard%2Fzopfli-ffi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/le0pard%2Fzopfli-ffi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/le0pard","download_url":"https://codeload.github.com/le0pard/zopfli-ffi/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223256674,"owners_count":17114723,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-05T23:13:20.648Z","updated_at":"2024-11-05T23:13:21.253Z","avatar_url":"https://github.com/le0pard.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Zopfli-ffi\n\n[![Build Status](https://travis-ci.com/le0pard/zopfli-ffi.svg?branch=master)](https://travis-ci.com/le0pard/zopfli-ffi)\n[![Code Climate](https://codeclimate.com/github/le0pard/zopfli-ffi/badges/gpa.svg)](https://codeclimate.com/github/le0pard/zopfli-ffi)\n\nRuby wrapper for [Zopfli](https://code.google.com/p/zopfli/) library. Zopfli Compression Algorithm is a new zlib (gzip, deflate) compatible compressor. This compressor takes more time (~100x slower), but compresses around 5% better than zlib and better than any other zlib-compatible compressor.\n\n### Requirements\n\nFirst of all you should have install libraries: zopfli, zlib.\n\nFor Ubuntu, Debian:\n\n    sudo apt-get install git build-essential zlib1g-dev\n\nNext you should install zopfli:\n\n    git clone https://github.com/Hello71/zopfli.git\n    cd zopfli\n    git submodule update --init\n    make -j2 \u0026\u0026 sudo make -j2 install\n\n\nThis gem is not support Windows and Mac OS systems (libzopfli isn't compiling on this systems).\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n    gem 'zopfli-ffi'\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install zopfli-ffi\n\n## Usage\n\nVery simple usage example:\n\n```ruby\nrequire 'zlib'\nrequire 'zopfli_ffi'\n\nuncompressed_file = 'spec/fixtures/test.txt'\ncompressed_file = 'spec/fixtures/test.txt.gz'\n\nZopfli.compress(uncompressed_file, compressed_file)\n\nuncompressed_data = File.read(uncompressed_file)\nuncompressed_zopfli_data = Zlib::Inflate.inflate File.read(compressed_file)\nuncompressed_zopfli_data == uncompressed_data # true\n```\n\nYou can define format of compression (`:zlib` is default):\n\n```ruby\nZopfli.compress(uncompressed_file, compressed_file, :zlib) # default format\nZopfli.compress(uncompressed_file, compressed_file, :deflate)\nZopfli.compress(uncompressed_file, compressed_file, :gzip)\n```\n\nAlso you can define number of iterations for compression (greater number - better compression, but slower compression time; default = 15):\n\n```ruby\nZopfli.compress(uncompressed_file, compressed_file, :zlib, 15) # default format\nZopfli.compress(uncompressed_file, compressed_file, :deflate, 5)\nZopfli.compress(uncompressed_file, compressed_file, :zlib, 25)\n```\n\n## Contributing\n\n1. Fork it ( http://github.com/le0pard/zopfli-ffi/fork )\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create new Pull Request\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fle0pard%2Fzopfli-ffi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fle0pard%2Fzopfli-ffi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fle0pard%2Fzopfli-ffi/lists"}