{"id":16484885,"url":"https://github.com/stephenmoloney/fastimage","last_synced_at":"2025-03-16T18:31:43.785Z","repository":{"id":10311844,"uuid":"65307188","full_name":"stephenmoloney/fastimage","owner":"stephenmoloney","description":"Find the type or size of an image","archived":false,"fork":false,"pushed_at":"2022-05-06T14:27:02.000Z","size":224,"stargazers_count":33,"open_issues_count":8,"forks_count":9,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-27T12:15:39.138Z","etag":null,"topics":["dimensions","elixir","elixir-lang","fastimage","image","image-analysis"],"latest_commit_sha":null,"homepage":"https://hex.pm/packages/fastimage","language":"Elixir","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/stephenmoloney.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-08-09T15:39:21.000Z","updated_at":"2024-07-21T05:33:55.000Z","dependencies_parsed_at":"2022-08-07T05:15:40.632Z","dependency_job_id":null,"html_url":"https://github.com/stephenmoloney/fastimage","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stephenmoloney%2Ffastimage","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stephenmoloney%2Ffastimage/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stephenmoloney%2Ffastimage/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stephenmoloney%2Ffastimage/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stephenmoloney","download_url":"https://codeload.github.com/stephenmoloney/fastimage/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243826783,"owners_count":20354220,"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":["dimensions","elixir","elixir-lang","fastimage","image","image-analysis"],"created_at":"2024-10-11T13:18:37.741Z","updated_at":"2025-03-16T18:31:42.939Z","avatar_url":"https://github.com/stephenmoloney.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Hex Version](http://img.shields.io/hexpm/v/fastimage.svg?style=flat-square)](https://hex.pm/packages/fastimage) [![Hex docs](http://img.shields.io/badge/hex.pm-docs-green.svg?style=flat-square)](https://hexdocs.pm/fastimage) [![License](https://img.shields.io/hexpm/l/fastimage.svg?style=flat-square)](https://github.com/stephenmoloney/fastimage/blob/master/LICENSE.md) [![Build Status](https://travis-ci.org/stephenmoloney/fastimage.svg)](https://travis-ci.org/stephenmoloney/fastimage) [![Code coverage status](https://coveralls.io/repos/github/stephenmoloney/fastimage/badge.svg?branch=master)](https://coveralls.io/github/stephenmoloney/fastimage?branch=master) \n![Hex.pm](https://img.shields.io/hexpm/dt/fastimage.svg)\n\n# Fastimage  \n\n## Description\n\nFastimage finds the dimensions/size or file type of a remote or local image file given the file path or url respectively.\nIt streams the smallest amount of data necessary to ascertain the file size. This aspect is useful when getting the\nfile size for very large images.\n\n## Features\n\n- Supports `bmp`, `jpeg`, `png`, `webp` and `gif` files\n- Supports local files by using the file path of the image\n- Supports blobs/objects by using the binary of the image\n- Supports remote files by using the url of the image\n- Follows redirects for a given url\n- `Fastimage.info/1` yields the image info as a struct `%Fastimage{}`\n- `Fastimage.size/1` yields the image size as a struct `%Fastimage.Dimensions{width: _w, height: _h}`\n- `Fastimage.type/1` yields the image type as an atom `:bmp, :jpeg, :gif, :webp or :png`\n\n## Examples\n\n```elixir\nFastimage.info(\"https://raw.githubusercontent.com/stephenmoloney/fastimage/master/priv/test.jpg\")\n# =\u003e {:ok,\n#      %Fastimage{\n#        dimensions: %Fastimage.Dimensions{height: 142, width: 283},\n#        image_type: :jpeg,\n#        source: \"https://raw.githubusercontent.com/stephenmoloney/fastimage/master/priv/test.jpg\",\n#        source_type: :url\n#      }}\n\nFastimage.type(\"https://raw.githubusercontent.com/stephenmoloney/fastimage/master/priv/test.jpg\")\n# =\u003e {:ok, :jpeg}\n\nFastimage.size(\"https://raw.githubusercontent.com/stephenmoloney/fastimage/master/priv/test.jpg\")\n# =\u003e {:ok, %Fastimage.Dimensions{height: 142, width: 283}}\n```\n\nSee [docs](https://hex.pm/packages/fastimage) for further examples\n\n## Installation\n\nAdd fastimage to your list of dependencies in `mix.exs`:\n\n```elixir\ndef deps do\n  [\n    {:fastimage, \"~\u003e 1.0.0-rc4\"}\n  ]\nend\n```\n\n## Tests\n\n```elixir\nmix test\n```\n\n## Benchmarks\n\n```elixir\nmix bench\n```\n\n## Credit/Acknowledgements\n\n- Based on [Ruby Fastimage](https://github.com/sdsykes/fastimage) by [Stephen Sykes](https://github.com/sdsykes)\n- Influenced by a [PHP version of fastimage](https://github.com/tommoor/fastimage) by [Tom Moor](https://github.com/tommoor)\n- Thanks to all [contributors](https://github.com/stephenmoloney/fastimage/graphs/contributors)\n\n## Licence\n\n[MIT Licence](LICENCE.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstephenmoloney%2Ffastimage","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstephenmoloney%2Ffastimage","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstephenmoloney%2Ffastimage/lists"}