{"id":17159678,"url":"https://github.com/schmidt/odf_thumb","last_synced_at":"2025-07-29T03:08:04.441Z","repository":{"id":56886194,"uuid":"59739727","full_name":"schmidt/odf_thumb","owner":"schmidt","description":"odf_thumb extracts existing thumbnail files from OpenDocument files","archived":false,"fork":false,"pushed_at":"2016-05-26T10:15:38.000Z","size":336,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-24T15:08:34.951Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/schmidt.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.txt","contributing":null,"funding":null,"license":null,"code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-05-26T09:56:31.000Z","updated_at":"2016-05-26T09:56:54.000Z","dependencies_parsed_at":"2022-08-21T00:20:43.995Z","dependency_job_id":null,"html_url":"https://github.com/schmidt/odf_thumb","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/schmidt/odf_thumb","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/schmidt%2Fodf_thumb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/schmidt%2Fodf_thumb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/schmidt%2Fodf_thumb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/schmidt%2Fodf_thumb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/schmidt","download_url":"https://codeload.github.com/schmidt/odf_thumb/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/schmidt%2Fodf_thumb/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267470106,"owners_count":24092359,"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","status":"online","status_checked_at":"2025-07-28T02:00:09.689Z","response_time":68,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-10-14T22:14:51.294Z","updated_at":"2025-07-29T03:08:04.417Z","avatar_url":"https://github.com/schmidt.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OdfThumb\n\nThis gem extracts existing thumbnail files from OpenDocument files, i.e. files\ncreated with OpenOffice or LibreOffice.\n\nIt cannot be guaranteed, that such a file exists. Most desktop applications will\ncreate and update such a file, while converters, export tools and command line\nutilities might not.\n\nAccording to\n[Wikipedia](https://en.wikipedia.org/w/index.php?title=OpenDocument_technical_specification\u0026oldid=695208884),\nthe thumbnail\n\n\u003e should be a representation of the first page, first sheet, etc. of the\n\u003e document. The required size for the thumbnails is 128x128 pixel. In order to\n\u003e conform to the [Thumbnail Managing\n\u003e Standard](http://standards.freedesktop.org/thumbnail-spec/latest/x142.html#AEN144)\n\u003e (TMS) at www.freedesktop.org, thumbnails must be saved as 8bit, non-interlaced\n\u003e PNG image with full alpha transparency.\n\n\n\n## Alternative approaches\n\nIf these properties do not meet your requirements, try creating a thumbnail\nby making use of LibreOffice's conversion capabilities. E.g. convert your\ndocument to a PNG and create a thumbnail based on that. The following command\nwill create a PNG called `Example.png` based on the first page of a OpenDocument\ntext file.\n\n    soffice --headless --convert-to png Example.odt\n\n\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'odf_thumb'\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install odf_thumb\n\n\n\n## Command line usage\n\nOdfThumb comes with a command line tool\n\n```\n# Creates a path/to/source.png\nodf_thumb path/to/source.odt\n\n# Creates a path/to/target/thumb.png\nodf_thumb path/to/source.odt -o path/to/target/thumb.png\n\n# Exits with error code 1 if the given file did not contain a thumbnail file\nodf_thumb other_file.txt\necho $? # =\u003e 1\n```\n\n\n\n## API usage\n\n```ruby\ndoc = OdfThumb::Document.new(\"source.odt\")\n\n# Returns true if document contains thumbnail file\ndoc.has_thumb?\n\n# Returns thumbnail as binary string, nil if has_thumb? == false\ndoc.thumbnail\n\n# Write thumbnail to given path, does nothing if has_thumb? == false\ndoc.write_thumbnail_to(\"thumb.odt\")\n```\n\n\n\n## Development\n\nAfter checking out the repo, run `bundle install` to install dependencies. Then,\nrun `rake test` to run the tests. You can also run `bin/console` for an\ninteractive prompt that will allow you to experiment.\n\nTo install this gem onto your local machine, run `bundle exec rake install`. To\nrelease a new version, update the version number in `version.rb`, and then run\n`bundle exec rake release`, which will create a git tag for the version, push\ngit commits and tags, and push the `.gem` file to\n[rubygems.org](https://rubygems.org).\n\n\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at\nhttps://github.com/schmidt/odf_thumb. This project is intended to be a safe,\nwelcoming space for collaboration, and contributors are expected to adhere to\nthe [Contributor Covenant](http://contributor-covenant.org) code of conduct.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fschmidt%2Fodf_thumb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fschmidt%2Fodf_thumb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fschmidt%2Fodf_thumb/lists"}