{"id":15287421,"url":"https://github.com/camelotproject/image-asset","last_synced_at":"2026-02-17T11:33:52.009Z","repository":{"id":62499224,"uuid":"201196997","full_name":"CamelotProject/image-asset","owner":"CamelotProject","description":"Image management library \u0026 bundle based on GD to handle image thumbnails","archived":false,"fork":false,"pushed_at":"2020-06-18T12:43:06.000Z","size":1244,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-24T02:48:27.182Z","etag":null,"topics":["assets","gd","images","jpg","png","svg","symfony-bundle","thumbnails","webp"],"latest_commit_sha":null,"homepage":"","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/CamelotProject.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":null,"license":null,"code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-08-08T06:54:02.000Z","updated_at":"2020-06-18T12:42:41.000Z","dependencies_parsed_at":"2022-11-02T12:01:25.205Z","dependency_job_id":null,"html_url":"https://github.com/CamelotProject/image-asset","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/CamelotProject/image-asset","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CamelotProject%2Fimage-asset","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CamelotProject%2Fimage-asset/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CamelotProject%2Fimage-asset/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CamelotProject%2Fimage-asset/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CamelotProject","download_url":"https://codeload.github.com/CamelotProject/image-asset/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CamelotProject%2Fimage-asset/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279002113,"owners_count":26083306,"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-10-09T02:00:07.460Z","response_time":59,"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":["assets","gd","images","jpg","png","svg","symfony-bundle","thumbnails","webp"],"created_at":"2024-09-30T15:28:06.161Z","updated_at":"2025-10-09T22:06:28.607Z","avatar_url":"https://github.com/CamelotProject.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"Camelot Image Asset\n===================\n\nInstallation\n------------\n\n### Applications that use Symfony Flex\n\nOpen a command console, enter your project directory and execute:\n\n```console\n$ composer require camelot/image-asset\n```\n\n### Applications that don't use Symfony Flex\n\n#### Step 1: Download the Bundle\n\nOpen a command console, enter your project directory and execute the\nfollowing command to download the latest stable version of this bundle:\n\n```console\n$ composer require camelot/image-asset\n```\n\nThis command requires you to have Composer installed globally, as explained\nin the [installation chapter](https://getcomposer.org/doc/00-intro.md)\nof the Composer documentation.\n\n#### Step 2: Enable the Bundle\n\nThen, enable the bundle by adding it to the list of registered bundles\nin the `config/bundles.php` file of your project:\n\n```php\n// config/bundles.php\n\nreturn [\n    // ...\n    Camelot\\ImageAsset\\Bridge\\Symfony\\CamelotImageAssetBundle::class =\u003e ['all' =\u003e true],\n];\n```\n\nConfiguration\n-------------\n\n### Default configuration\n\n```yaml\n# config/packages/camelot_image_asset.yaml\ncamelot_image_asset:\n    image_dirs:\n        - '%kernel.project_dir%/public/images'\n    static_path: '%kernel.project_dir%/public/thumbs'\n    routing:\n        mount_point: /thumbs\n        image:\n            controller: Camelot\\ImageAsset\\Controller\\ImageController\n            path: '/{width}x{height}/{action}/{file}'\n        image_alias:\n            controller: Camelot\\ImageAsset\\Controller\\ImageAliasController\n            path: '/{alias}/{file}'\n    default_image:\n        path: image-default.png\n        filesystem: camelot.image.filesystem.bundle\n    default_image_size:\n        width: 1024\n        height: 768\n    error_image:\n        path: image-error.png\n        filesystem: camelot.image.filesystem.bundle\n    cache_time: null\n    limit_upscaling: true\n    only_aliases: false\n    aliases: ~\n```\n\n### Aliases\n\n```yaml\n# config/packages/camelot_image_asset.yaml\ncamelot_image_asset:\n    # ...\n\n    aliases:\n        my_alias:\n            image_size:\n                width: 1024\n                height: 768\n            action: ~ # One of \"border\"; \"crop\"; \"fit\"; \"resize\"\n        other_alias:\n            image_size:\n                width:  1900\n                height: 1200\n            action: ~ # One of \"border\"; \"crop\"; \"fit\"; \"resize\"\n```\n\n### Routing\n\n```yaml\n# config/routes/camelot_image_asset.yaml\ncamelot_image_asset:\n    resource: .\n    type: image_asset\n    prefix: /\n```\n\nUsage\n-----\n\n### Twig\n\n```twig\n    {% set uri = '/images/image.png' %}\n\n    {# This will be cropped to the default width \u0026 height #}\n    \u003cimg src=\"{{ thumbnail(uri, my_alias) }}\"\u003e\n\n    {# Same, but path resolved by Symfony's asset() Twig function #}\n    {% set package_name = 'my_symfony_asset_package_name' %} # See config/packages/assets.yaml\n    \u003cimg src=\"{{ thumbnail(asset(uri, package_name), my_alias) }}\"\u003e\n```\n\nNGINX Optimisation\n------------------\n\n```nginx\nlocation ~* /thumbs/(.*)$ {\n    try_files $uri $uri/ /index.php?$query_string;\n}\n\nlocation ~* ^.+\\.(?:gif|jpe?g|jpeg|jpg|png|svg|svgz)$ {\n    access_log          off;\n    log_not_found       off;\n    expires             max;\n    add_header          Access-Control-Allow-Origin \"*\";\n    add_header          Cache-Control \"public, mustrevalidate, proxy-revalidate\";\n    add_header          Pragma public;\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcamelotproject%2Fimage-asset","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcamelotproject%2Fimage-asset","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcamelotproject%2Fimage-asset/lists"}