{"id":20251719,"url":"https://github.com/maximal/php-avif-thumbnailer","last_synced_at":"2025-03-03T16:41:03.173Z","repository":{"id":63716903,"uuid":"570151999","full_name":"maximal/php-avif-thumbnailer","owner":"maximal","description":"PHP (over Imagine and ffmpeg) helper for creating and caching AVIF thumbnails in real time","archived":false,"fork":false,"pushed_at":"2022-11-24T13:06:49.000Z","size":5,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-15T06:05:35.159Z","etag":null,"topics":[],"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/maximal.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":"2022-11-24T13:03:11.000Z","updated_at":"2024-04-26T07:45:29.000Z","dependencies_parsed_at":"2022-11-24T15:19:35.670Z","dependency_job_id":null,"html_url":"https://github.com/maximal/php-avif-thumbnailer","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maximal%2Fphp-avif-thumbnailer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maximal%2Fphp-avif-thumbnailer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maximal%2Fphp-avif-thumbnailer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maximal%2Fphp-avif-thumbnailer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/maximal","download_url":"https://codeload.github.com/maximal/php-avif-thumbnailer/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241702403,"owners_count":20005960,"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":[],"created_at":"2024-11-14T10:12:29.017Z","updated_at":"2025-03-03T16:41:03.154Z","avatar_url":"https://github.com/maximal.png","language":"PHP","readme":"# PHP thumbnailer with AVIF support\n\n`AvifThumbnailer` is a thumbnail helper which allows you to generate\nand cache image thumbnails in your PHP application on the fly.\n\n\n## Installation\n\nInstall this library with Composer:\n```bash\ncomposer require \"maximal/php-avif-thumbnailer\"\n```\nor add\n```\n\"maximal/php-avif-thumbnailer\": \"^1.0\"\n```\nto the `require` section of your app’s `composer.json` file.\n\n\n## Checking the environment\n\nYou will need FFMPEG with AVIF (AV1) coder installed in your system. \n\nFor instance in Ubuntu/Debian it is included in `ffmpeg` package:\n```bash\nsudo apt install ffmpeg\n```\n\nCheck the command:\n```bash\nffmpeg -version\n```\nYou should get an output with the version number. Every version after `4.3` should be fine.\n\nIf you have installed `ffmpeg` to a different command or path, configure\nthe static property `AvifThumbnailer::$ffmpegCommand` before using the helper\n(see the example below).\n\nMore info about AVIF: https://avif.io/blog/\n\n\n## Generating thumbnails\n\nUse this thumbnailer in your PHP application:\n```php\nuse Maximal\\Thumbnailers\\AvifThumbnailer;\n\necho AvifThumbnailer::picture('/path/to/img/image.png', $width, $height);\n```\n\nMore options (`outbound`  instead of default `inset`; `alt` and `class`\nattribute added):\n```php\nuse Maximal\\Thumbnailers\\AvifThumbnailer;\n\necho AvifThumbnailer::picture(\n\t'/path/to/img/image.png',\n\t$width,\n\t$height,\n\tfalse,\n\t['alt' =\u003e 'Alt attribute', 'class' =\u003e 'img-responsive']\n);\n```\n\nCustom `ffmpeg` command:\n```php\nuse Maximal\\Thumbnailers\\AvifThumbnailer;\n\nAvifThumbnailer::$ffmpegCommand = '/usr/local/bin/ffmpeg';\necho AvifThumbnailer::picture('/path/to/img/image.jpg', $width, $height);\n```\n\nThe helper’s `picture()` method uses modern `\u003cpicture\u003e` HTML tag as follows:\n```html\n\u003cpicture data-cache=\"hit|new|fail\"\u003e\n\t\u003csource srcset=\"/assets/thumbnails/...image.png.avif\" type=\"image/avif\" /\u003e\n\t\u003cimg src=\"/assets/thumbnails/...image.png\" other-attributes=\"\" /\u003e\n\u003c/picture\u003e\n```\n\nHere you have `image/avif` source for\n[browsers which support AVIF images](https://caniuse.com/#search=AVIF)\nand traditional (PNG, JPEG, TIFF, GIF) image fallback.\n\n\n# Author\n\n* Websites: https://maximals.ru and https://sijeko.ru\n* StackOverflow story: http://stackoverflow.com/users/story/1021887\n* Twitter: https://twitter.com/almaximal\n* Telegram: https://t.me/maximal\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaximal%2Fphp-avif-thumbnailer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaximal%2Fphp-avif-thumbnailer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaximal%2Fphp-avif-thumbnailer/lists"}