{"id":22711226,"url":"https://github.com/yiicod/yii2-easyimage","last_synced_at":"2025-09-09T11:36:51.438Z","repository":{"id":57087165,"uuid":"84072611","full_name":"yiicod/yii2-easyimage","owner":"yiicod","description":null,"archived":false,"fork":false,"pushed_at":"2018-02-18T18:22:30.000Z","size":10,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-13T15:12:33.983Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","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/yiicod.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2017-03-06T12:50:07.000Z","updated_at":"2019-12-13T19:21:39.000Z","dependencies_parsed_at":"2022-08-24T04:23:17.602Z","dependency_job_id":null,"html_url":"https://github.com/yiicod/yii2-easyimage","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/yiicod/yii2-easyimage","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yiicod%2Fyii2-easyimage","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yiicod%2Fyii2-easyimage/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yiicod%2Fyii2-easyimage/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yiicod%2Fyii2-easyimage/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yiicod","download_url":"https://codeload.github.com/yiicod/yii2-easyimage/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yiicod%2Fyii2-easyimage/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274291354,"owners_count":25258156,"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-09-09T02:00:10.223Z","response_time":80,"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-12-10T12:15:00.610Z","updated_at":"2025-09-09T11:36:51.401Z","avatar_url":"https://github.com/yiicod.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"Yii EasyImage extension\n=======================\n\n[![Latest Stable Version](https://poser.pugx.org/yiicod/yii2-easyimage/v/stable)](https://packagist.org/packages/yiicod/yii2-easyimage) [![Total Downloads](https://poser.pugx.org/yiicod/yii2-easyimage/downloads)](https://packagist.org/packages/yiicod/yii2-easyimage) [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/yiicod/yii2-easyimage/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/yiicod/yii2-easyimage/?branch=master)[![Code Climate](https://codeclimate.com/github/yiicod/yii2-easyimage/badges/gpa.svg)](https://codeclimate.com/github/yiicod/yii2-easyimage)\n\nYou don't need to create many types of thumbnails for images in your project.\nYou can create a thumbnail directly in the `View`. Thumbnail will automatically cached. It's easy!\n  \nFeatures:\n- Easy to use\n- Support `Imagick`, `Gmagick` and `GD2`\n- Automatically images caching\n- Cache sorting to subdirectories\n\n### Installing and configuring\nAdd the following to your config file `components` section:\n\n```php\n'easyimage' =\u003e [\n    'class' =\u003e 'yiicod\\easyimage\\EasyImage',\n    'webrootAlias' =\u003e '@frontend/web',\n    'cachePath' =\u003e '/uploads/easyimage/',\n    'imageOptions' =\u003e [\n        'quality' =\u003e 100\n    ],\n],\n```\n#### Parameters\n- string `webrootAlias` webroot folder path\n- string `cachePath` cache directory path in webroot folder\n- array `imageOptions` array with default output image options which will used by Imagine to save image\n\n## Usage\n```php\nYii::$app-\u003eeasyimage-\u003egetUrl($file, $params, $absolute); //Get cached image url\nYii::$app-\u003eeasyimage-\u003egetPath($file, $params); //Get cached image path\n\nNote: you can get access to the component using static method EasyImage::getInstance()\n```\n\n#### Parameters\n- string `$file` required - Image file path\n- array `$params` image tools params Default: []\n- mixed `$absolute` get absolute (true) url or not (false). Will use in Url::to() helper method\n\n### Available tools and parameters\n```php\n'crop' =\u003e [\n    'width' =\u003e 200, //Required\n    'height' =\u003e 200, //Required\n    'offset_x' =\u003e 100,\n    'offset_y' =\u003e 100,\n],\n'flip' =\u003e [\n    'axis' =\u003e 'vertical', //Required available 'vertical' or 'horizontal'\n],\n'resize' =\u003e [\n    'width' =\u003e 200, //Required\n    'height' =\u003e 200, //Required\n],\n'scale' =\u003e [\n    'width' =\u003e 200, //Required\n    'height' =\u003e 200, //Required\n],\n'rotate' =\u003e [\n    'angle' =\u003e 45 //Required\n],\n'thumbnail' =\u003e [\n    'width' =\u003e 100, //Required one of dimensions\n    'height' =\u003e 100, //Required one of dimensions\n],\n'watermark' =\u003e [\n    'image' =\u003e $file, //Required\n    'offset_x' =\u003e 100,\n    'offset_y' =\u003e 100,\n],\n'background' =\u003e [\n    'color' =\u003e '#000', //Required\n    'alpha' =\u003e 0 //Background color's alpha\n],\n```\n\n### Tools\nYou can add additional tools in config:\n```php\n'easyimage' =\u003e [\n    'class' =\u003e 'yiicod\\easyimage\\EasyImage',\n    'webrootAlias' =\u003e '@frontend/web',\n    'cachePath' =\u003e '/uploads/easyimage/',\n    'tools' =\u003e [\n        'crop' =\u003e Crop::class,\n    ],\n],\n```\n- 'crop' - tool name which will use in getUrl() or getPath() params\n- Crop::class - tool class name which must implement yiicod\\easyimage\\base\\ToolInterface","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyiicod%2Fyii2-easyimage","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyiicod%2Fyii2-easyimage","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyiicod%2Fyii2-easyimage/lists"}