{"id":26524900,"url":"https://github.com/endotakuya/ires","last_synced_at":"2025-03-21T14:24:15.568Z","repository":{"id":56878001,"uuid":"104182141","full_name":"endotakuya/ires","owner":"endotakuya","description":"image resizer","archived":false,"fork":false,"pushed_at":"2019-01-10T04:43:09.000Z","size":42164,"stargazers_count":4,"open_issues_count":3,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-20T15:02:11.711Z","etag":null,"topics":["golang","ruby","ruby-gem","ruby-on-rails"],"latest_commit_sha":null,"homepage":"","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/endotakuya.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-09-20T07:34:33.000Z","updated_at":"2019-02-22T09:33:26.000Z","dependencies_parsed_at":"2022-08-20T23:10:12.830Z","dependency_job_id":null,"html_url":"https://github.com/endotakuya/ires","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/endotakuya%2Fires","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/endotakuya%2Fires/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/endotakuya%2Fires/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/endotakuya%2Fires/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/endotakuya","download_url":"https://codeload.github.com/endotakuya/ires/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244637080,"owners_count":20485445,"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":["golang","ruby","ruby-gem","ruby-on-rails"],"created_at":"2025-03-21T14:24:14.877Z","updated_at":"2025-03-21T14:24:15.552Z","avatar_url":"https://github.com/endotakuya.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ires\n\n[![Gem Version](https://badge.fury.io/rb/ires.svg)](https://badge.fury.io/rb/ires)\n\n\n`Ires` is image resizer gem.\n\n## Usage\n\n### View\n\n```erb\n\u003c!-- Usually --\u003e\n\u003c%= ires_tag(\"image_01.jpg\", width: 90, height: 120) %\u003e\n\n\u003c!-- Using image_tag options --\u003e\n\u003c%= ires_tag(\"http://example.com/image_02.jpg\", width: 200, height: 200, Ires::Mode::CROP, alt: \"example image\") %\u003e\n```\n\n### Get resize path\n\n```ruby\nIres::Service.path('\u003cFULL IMAGE PATH\u003e', width: 400, height: 300)\n=\u003e /ires/\u003cresize image path\u003e\n```\n\n### Select mode\n\n| info                       |     　　        mode       　　　  |\n|:---------------------------|:---------------------------------|\n| Resize                     | Ires::Mode::RESIZE (default)     |\n| Cropping                   | Ires::Mode::CROP                 |\n| Rsize after Cropping       | Ires::Mode::RESIZE_TO_CROP       |\n\n### Select type\n\nFilter of resize image.\n\n| info                       |     　　       type        　　　  |\n|:---------------------------|:---------------------------------|\n| All                        | Ires::Type::ALL (default)        |\n| Smaller than               | Ires::Type::SMALLER              |\n| Larger than                | Ires::Type::LARGER               |\n\n### Specify cache expiration\n\nDefault: **30days**\n\n```erb\n\u003c%= ires_tag('/image.jpg', width: 400, height: 300, expire: 7.days) %\u003e\n```\n\n### Saved directory\n\n####  Target image is local\n\n```\npublic\n├── image.jpg\n└── ires\n    ├── crop\n    │   ├── 20171019_image_120x90_crop.jpg\n    │   ├── 20171117_image_200x200_crop.jpg\n    │   └── 20171117_image_400x300_crop.jpg\n    ├── resize\n    │   ├── 20171019_image_120x90_resize.jpg\n    │   ├── 20171117_image_200x200_resize.jpg\n    │   └── 20171117_image_400x300_resize.jpg\n    └── resize_to_crop\n        ├── 20171019_image_120x90_resize_to_crop.jpg\n        ├── 20171117_image_200x200_resize_to_crop.jpg\n        └── 20171117_image_400x300_resize_to_crop.jpg\n```\n\n#### Target image is http\n\nParse URL \u0026 Create directory by parse URL.\n\n\n## Installation\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'ires'\n```\n\nAnd then execute:\n```bash\n$ bundle\n```\n\nOr install it yourself as:\n```bash\n$ gem install ires\n```\n\n## Caution\n\n- It works only with `linux` and `darwin` now.\n- Can build only linux（.so）in this docker.\n\n\n## Development\n\nDocker environment.\n\n```shell\n$ docker build -t ires:v1 .\n\n# Into the ires container.\n$ docker run -it -v $(pwd):/go/src/github.com/endotakuya/ires -p 3000:3000 ires:v1 /bin/bash\n```\n\n## Gem test\n\nWorking in ires container.\n\n### 1. Go（Create a shared object）\n\nPackage manager is [dep](https://github.com/golang/dep).\n\n```shell\n# Dependent resolution\n$ dep ensure\n\n# Output to a shared object.\n$ CGO_ENABLED=1 GOOS=linux go build -v -buildmode=c-shared -o shared/linux/ires.so ext/main.go\n```\n※ In the current Docker, you can build only linux environment.  \n※ If you want to build in other environments, add GCC or install Go on the host side.🙇\n\n### 2. Start rails server\n\n```shell\n$ test/dummy/bin/rails s -b 0.0.0.0\n```\n\n## License\nThe gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fendotakuya%2Fires","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fendotakuya%2Fires","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fendotakuya%2Fires/lists"}