{"id":21107251,"url":"https://github.com/glaivepro/image","last_synced_at":"2026-05-19T19:03:54.961Z","repository":{"id":51026831,"uuid":"520210332","full_name":"GlaivePro/image","owner":"GlaivePro","description":null,"archived":false,"fork":false,"pushed_at":"2024-05-10T13:38:01.000Z","size":122,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-07-07T05:46:15.970Z","etag":null,"topics":["hacktoberfest","image-manipulation","laravel"],"latest_commit_sha":null,"homepage":"","language":"PHP","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/GlaivePro.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-08-01T17:52:36.000Z","updated_at":"2024-05-10T13:37:58.000Z","dependencies_parsed_at":"2024-11-20T03:47:04.554Z","dependency_job_id":null,"html_url":"https://github.com/GlaivePro/image","commit_stats":{"total_commits":56,"total_committers":4,"mean_commits":14.0,"dds":0.1071428571428571,"last_synced_commit":"c99642496553b9dcb137dc9195eec6fef7187b88"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/GlaivePro/image","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GlaivePro%2Fimage","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GlaivePro%2Fimage/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GlaivePro%2Fimage/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GlaivePro%2Fimage/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GlaivePro","download_url":"https://codeload.github.com/GlaivePro/image/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GlaivePro%2Fimage/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265228153,"owners_count":23731067,"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":["hacktoberfest","image-manipulation","laravel"],"created_at":"2024-11-20T00:37:23.347Z","updated_at":"2026-05-19T19:03:54.915Z","avatar_url":"https://github.com/GlaivePro.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Image\n\nImage manipulation via URLs for Laravel. It provides a URL interface, while\nthe manipulations themselves are done by [Intervention](https://image.intervention.io/).\n\nThe manipulated files are stored at the requested URL so the manipulation won't\nbe repeated, but the file will directly be served by your web server.\n\nThis package is heavily inspired by [folklore/image](https://github.com/folkloreinc/laravel-image-legacy).\n\n## Installation\n\n```sh\ncomposer require glaivepro/image\n```\n\nCurrently this package does not publish any config, but the manipulations are\ndone by intervention. In case you need to change the driver to imagick, you\nshould [configure intervention](https://image.intervention.io/v2/introduction/configuration#configuration-in-laravel).\n\n## Usage\n\nLet us consider an image that's publicly accessible as `example.com/img/some.jpg`.\n\nThis package will let you get a downsized and cropped version of this file via\nthe URL `example.com/img/some-image(120x150).jpg`. The manipulated image will\nbe stored in the `img` directory as `some-image(120x150).jpg` so that the next\nrequest to `example.com/img/some-image(120x150).jpg` will be handled by your\nweb server providing the stored file.\n\nIf you want to downsize, but keep the aspect ratio, skip one of the dimensions:\n\n- `example.com/img/some-image(200x_).jpg` — constrain width\n- `example.com/img/some-image(_x90).jpg` — constrain height\n\nFew other manipulations are available as well:\n\n- `example.com/img/some-image(blur).jpg`\n- `example.com/img/some-image(blur(10)).jpg`\n- `example.com/img/some-image(pixelate(12)).jpg`\n- `example.com/img/some-image(resize(120,140)).jpg` — resizing without cropping\n- `example.com/img/some-image(100x200-pixelate(10)).jpg`\n- `example.com/img/some-image(resize(120,140)-blur-pixelate(12)).jpg`\n\n### Generating URLs\n\nThe simple (size constraining) URIs can be generated via our facade:\n\n```php\n$uri = GPImage::url('img/some-image.jpg', 120, 150);\n// $uri is 'img/some-image-image(120x150).jpg'\n```\n\n\u003e **Note**\n\u003e The method is named `url` for compatibility with `folklore/image`. Even\n\u003e though this is not intended as a drop-in replacement, this case will be such\n\u003e if you redefine `Image` facade alias to point to `GlaivePro\\Image\\GPImage`.\n\nFull URLs can be generated via the `asset` method:\n\n```php\n$url = GPImage::asset('img/some-image.jpg', 120, 150);\n// $url is 'https://example.com/img/some-image-image(120x150).jpg'\n```\n\nMore complex URIs can be generated using the stringable `Uri` class:\n\n```php\nuse GlaivePro\\Image\\Uri;\n\n$uri = new Uri('pic.jpg');\n$uri-\u003esize(20, 400);\n\n(string) $uri; // 'pic-image(20x400).jpg'\n```\n\nInstances of `Uri` can also be produced by the `url` and `asset` methods\nof the `GPImage` facade:\n\n```php\nGPImage::asset('pic.jpg')-\u003epixelate(12)-\u003eblur(10)-\u003eresize(100, 200);\n// https://example.com/pic-image(pixelate(12)-blur(10)-resize(100,200)).jpg\n```\n\n### Custom filters\n\nYou can register your own filters that will receive the intervention instance\nand any arguments which you can then handle as needed:\n\n```php\n// Called via 'somepic-image(simplefilter).jpg'\nGPImage::filter('simplefilter', fn ($image) =\u003e $image-\u003eanyInterventionMethod());\n\n// Called via 'somepic-image(complexfilter(10,20))'\nGPImage::filter('complexfilter', function($image, $arg1, $arg2) {\n\t$tempArg = $arg1 * 2;\n\t$image-\u003esomeInterventionMethod($tempArg, $arg1);\n\t$image-\u003esomeOtherInterventionMethod();\n});\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fglaivepro%2Fimage","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fglaivepro%2Fimage","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fglaivepro%2Fimage/lists"}