{"id":18637961,"url":"https://github.com/imponeer/smarty-image","last_synced_at":"2025-04-11T10:30:58.695Z","repository":{"id":38012033,"uuid":"335705806","full_name":"imponeer/smarty-image","owner":"imponeer","description":"Smarty plugin that adds some image related template syntax enchaments","archived":false,"fork":false,"pushed_at":"2024-08-01T17:53:44.000Z","size":105,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-11-03T11:49:45.430Z","etag":null,"topics":["hacktoberfest","image-processing","smarty","smarty-plugins"],"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/imponeer.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-02-03T17:40:10.000Z","updated_at":"2024-08-01T17:53:47.000Z","dependencies_parsed_at":"2024-05-21T22:31:14.799Z","dependency_job_id":"250618b2-6b06-47ad-87fd-ea75f7601396","html_url":"https://github.com/imponeer/smarty-image","commit_stats":{"total_commits":25,"total_committers":3,"mean_commits":8.333333333333334,"dds":0.36,"last_synced_commit":"64488a9c71c96a20c9d923e03da28f96fd9985f6"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imponeer%2Fsmarty-image","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imponeer%2Fsmarty-image/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imponeer%2Fsmarty-image/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imponeer%2Fsmarty-image/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/imponeer","download_url":"https://codeload.github.com/imponeer/smarty-image/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223466133,"owners_count":17149768,"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-processing","smarty","smarty-plugins"],"created_at":"2024-11-07T05:38:27.479Z","updated_at":"2024-11-07T05:38:28.080Z","avatar_url":"https://github.com/imponeer.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![License](https://img.shields.io/github/license/imponeer/smarty-image.svg)](LICENSE)\n[![GitHub release](https://img.shields.io/github/release/imponeer/smarty-image.svg)](https://github.com/imponeer/smarty-image/releases) [![Maintainability](https://api.codeclimate.com/v1/badges/c284ca86c6df6e98b9d0/maintainability)](https://codeclimate.com/github/imponeer/smarty-image/maintainability) [![PHP](https://img.shields.io/packagist/php-v/imponeer/smarty-image.svg)](http://php.net) \n[![Packagist](https://img.shields.io/packagist/dm/imponeer/smarty-image.svg)](https://packagist.org/packages/imponeer/smarty-image)\n\n# Smarty Image\n\nSome [Smarty](https://smarty.net) syntax plugins for operations with images.\n\n## Installation\n\nTo install and use this package, we recommend to use [Composer](https://getcomposer.org):\n\n```bash\ncomposer require imponeer/smarty-image\n```\n\nOtherwise, you need to include manually files from `src/` directory. \n\n## Registering in Smarty\n\nIf you want to use these extensions from this package in your project you need register them with [`registerPlugin` function](https://www.smarty.net/docs/en/api.register.plugin.tpl) from [Smarty](https://www.smarty.net). For example:\n```php\n$smarty = new \\Smarty();\n$resizeImagePlugin = new \\Imponeer\\Smarty\\Extensions\\Image\\ResizeImageFunction($psrCacheAdapter);\n$smarty-\u003eregisterPlugin('function', $resizeImagePlugin-\u003egetName(), [$resizeImagePlugin, 'execute']);\n```\n\n## Using from templates\n\nTo resize images from smarty You can use resized_image function:\n```smarty\n  {resized_image file=\"/images/image.jpg\" height=70}\n```\n\nThis function supports such arguments:\n\n| Argument | Required | Default value | Description |\n|----------|----------|---------------|-------------|\n| `file`     | yes      |               | Image file to resize |\n| `width`    | if `height` is not specified | | Resized image width |\n| `height`   | if `width` is not specified | | Resized image height |\n| `fit`     | no | `outside` | Method used for resize. Supported `fill`, `inside`, `outside` |\n| `href` or `link`    | no | | if specified and `return` is set to `image`, will output generated HTML as image with link to this specific location | \n| `basedir` | no | $_SERVER['DOCUMENT_ROOT'] | Base dir where to look for image files |\n| `return` | no | `image` | Returns result as HTML tag if value is `image`, or as resized image URI if value is `url`.  |\n\nAll extra arguments will be rendered into image tag, if return mode is `image`.\n\n## How to contribute?\n\nIf you want to add some functionality or fix bugs, you can fork, change and create pull request. If you not sure how this works, try [interactive GitHub tutorial](https://skills.github.com).\n\nIf you found any bug or have some questions, use [issues tab](https://github.com/imponeer/smarty-image/issues) and write there your questions.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimponeer%2Fsmarty-image","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fimponeer%2Fsmarty-image","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimponeer%2Fsmarty-image/lists"}