{"id":33990524,"url":"https://github.com/xavier83ar/image-presenter","last_synced_at":"2026-05-28T01:03:43.225Z","repository":{"id":57083396,"uuid":"51886789","full_name":"xavier83ar/image-presenter","owner":"xavier83ar","description":"A CakePHP plugin for creating thumbnails and image variants on the fly","archived":false,"fork":false,"pushed_at":"2016-02-23T22:16:29.000Z","size":1409,"stargazers_count":1,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-14T18:18:30.611Z","etag":null,"topics":["cakephp","cakephp-plugin","helper","image","image-processing","thumbnails"],"latest_commit_sha":null,"homepage":null,"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/xavier83ar.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":"2016-02-17T02:13:12.000Z","updated_at":"2018-07-10T15:26:49.000Z","dependencies_parsed_at":"2022-08-24T14:58:29.659Z","dependency_job_id":null,"html_url":"https://github.com/xavier83ar/image-presenter","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/xavier83ar/image-presenter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xavier83ar%2Fimage-presenter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xavier83ar%2Fimage-presenter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xavier83ar%2Fimage-presenter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xavier83ar%2Fimage-presenter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xavier83ar","download_url":"https://codeload.github.com/xavier83ar/image-presenter/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xavier83ar%2Fimage-presenter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33589685,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-27T02:00:06.184Z","response_time":53,"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":["cakephp","cakephp-plugin","helper","image","image-processing","thumbnails"],"created_at":"2025-12-13T06:16:37.989Z","updated_at":"2026-05-28T01:03:43.206Z","avatar_url":"https://github.com/xavier83ar.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ImagePresenter plugin for CakePHP\n\n## Installation\n\nYou can install this plugin into your CakePHP application using [composer](http://getcomposer.org).\n\nThe recommended way to install composer packages is:\n\n```\ncomposer require xavier83ar/image-presenter\n```\n\n## Usage\n\nLoad the plugin\n\n```php\nPlugin::load('ImagePresenter', ['routes' =\u003e true]);\n```\n\nConfigure your variants...\n\n```php\n'ImagePresenter' =\u003e [\n    'variants' =\u003e [\n        'thumbnail' =\u003e [\n            'size' =\u003e [350, 250],\n            'mode' =\u003e ImageInterface::THUMBNAIL_OUTBOUND,\n            'filter' =\u003e ImageInterface::FILTER_LANCZOS\n        ],\n        'mini' =\u003e [\n            'operation' =\u003e 'thumbnail',\n            'size' =\u003e [120, 120],\n            'mode' =\u003e ImageInterface::THUMBNAIL_INSET,\n        ],\n        'other' =\u003e [\n            'operation' =\u003e function (ImageInterface $imagine) {\n                return $imagine-\u003eresize(new Box(400, 300))-\u003erotate(90);\n            }\n        ],\n        'amazing' =\u003e [\n            'operation' =\u003e function (ImageInterface $imagine) {\n                return $imagine\n                    -\u003eresize(new Box(600, 320))\n                    -\u003eeffects()-\u003egrayscale()-\u003eblur(5);\n            }\n        ],\n    ],\n]\n```\n\nAny variant which its name starts with \"thumbnail\" will use thumbnail operation mode. Right now there two operation modes:\nthumbnail, which sets up a `ImageInterface::thumbnail()` operation, and closure mode, which allows you to pass a \nclosure which receive an `ImageInterface` to play with.  \n\nThis helpers uses imagine/imagine package for image manipulation operations, see https://imagine.readthedocs.org/en/latest/ \nfor more information.\n\n### Showing up images\n\nFinally load and use ImageHelper\n\n```php\nclass AppView extends View\n{\n    public function initialize()\n    {\n        $this-\u003eloadHelper('ImagePresenter.Image');\n    }\n}\n```\n\nOn your templates\n\n```php\n\u003cimg src=\"\u003c?= $this-\u003eImage-\u003evariant($img, 'thumbnail') ?\u003e\" alt=\"\"\u003e\n```\n\n`ImagePresenter\\View\\Helper\\ImageHelper::variant()` method will only check if exists a file for that variant, if it does, then it will return the path to that file relative to webroot, if not, it will return the path to the `PresenterController` which takes care of generate that variant and serve the file.\n\nThis way variants are created only when needed, and only once.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxavier83ar%2Fimage-presenter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxavier83ar%2Fimage-presenter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxavier83ar%2Fimage-presenter/lists"}