{"id":18517812,"url":"https://github.com/femtopixel/crop","last_synced_at":"2025-07-05T09:36:19.001Z","repository":{"id":62504074,"uuid":"61115748","full_name":"femtopixel/crop","owner":"femtopixel","description":"PHP Component to resize images from a configuration file","archived":false,"fork":false,"pushed_at":"2024-05-02T16:14:24.000Z","size":125,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-14T07:09:22.634Z","etag":null,"topics":["crop","dimensions","distortion","image","packagist","php","resized-images"],"latest_commit_sha":null,"homepage":"https://brands.jaymoulin.me/femtopixel/crop/","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/femtopixel.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE.md","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},"funding":{"github":["jaymoulin"],"patreon":null,"open_collective":null,"ko_fi":"jaymoulin","tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":["https://www.paypal.me/jaymoulin","https://www.buymeacoffee.com/jaymoulin","https://www.tipeeestream.com/cursedware/donation","https://streamlabs.com/cursedware/tip"]}},"created_at":"2016-06-14T11:01:16.000Z","updated_at":"2024-05-02T16:14:27.000Z","dependencies_parsed_at":"2025-04-10T01:42:40.681Z","dependency_job_id":null,"html_url":"https://github.com/femtopixel/crop","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/femtopixel/crop","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/femtopixel%2Fcrop","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/femtopixel%2Fcrop/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/femtopixel%2Fcrop/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/femtopixel%2Fcrop/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/femtopixel","download_url":"https://codeload.github.com/femtopixel/crop/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/femtopixel%2Fcrop/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263719804,"owners_count":23501109,"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":["crop","dimensions","distortion","image","packagist","php","resized-images"],"created_at":"2024-11-06T17:09:23.200Z","updated_at":"2025-07-05T09:36:18.983Z","avatar_url":"https://github.com/femtopixel.png","language":"PHP","funding_links":["https://github.com/sponsors/jaymoulin","https://ko-fi.com/jaymoulin","https://www.paypal.me/jaymoulin","https://www.buymeacoffee.com/jaymoulin","https://www.tipeeestream.com/cursedware/donation","https://streamlabs.com/cursedware/tip","https://www.ko-fi.com/jaymoulin"],"categories":[],"sub_categories":[],"readme":"\u003e [!CAUTION]\n\u003e As-of 2021, this product does not have a free support team anymore. If you want this product to be maintained, please support my work.\n \n\u003e [!NOTE]\n\u003e (This product is available under a free and permissive license, but needs financial support to sustain its continued improvements. In addition to maintenance and stability there are many  desirable features yet to be added.)\n\n![logo](logo.png)\n\nCrop\n====\n\n[![Latest Stable Version](https://poser.pugx.org/femtopixel/crop/v/stable)](https://packagist.org/packages/femtopixel/crop) \n[![Minimum PHP Version](https://img.shields.io/badge/php-%3E%3D%207.0-8892BF.svg?style=flat-square)](https://php.net/)\n[![License](https://poser.pugx.org/femtopixel/crop/license)](https://packagist.org/packages/femtopixel/crop)\n[![PayPal donation](https://github.com/jaymoulin/jaymoulin.github.io/raw/master/ppl.png \"PayPal donation\")](https://www.paypal.me/jaymoulin)\n[![Buy me a coffee](https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png \"Buy me a coffee\")](https://www.buymeacoffee.com/jaymoulin)\n[![Buy me a coffee](https://ko-fi.com/img/githubbutton_sm.svg \"Buy me a coffee\")](https://www.ko-fi.com/jaymoulin)\n\nThis component will resize images following configuration rules.\nallows only defined format\n\n## Installation\n\n```\ncomposer require femtopixel/crop\n```\n\n## Usage\n\n```php\n\u003c?php\n$formats = array(\n    'mini' =\u003e array(\n        'width' =\u003e 100,\n        'height' =\u003e 100,\n        'full' =\u003e 'cropped',\n    ),\n);\n$image = new \\FemtoPixel\\Crop\\Crop('/path/to/file.png', 'mini');\n$image-\u003esetFormatsFromArray($formats)-\u003erender();\n```\n\nYou can define as many format that you want!\n\n- First parameter is path to your file to display\n- Second (optional) is the format you want to display in (default : 'original' (no modification))\n- Third (optional) is path to default image displayed if path in first parameter doesn't exist. This file will be displayed in requested format. (default : 'src/missing.png')\n \n## Configuration\n\nEach format given in method `setFormatsFromArray` must define `width`, `height` and optional `full` index.\n \n`full` can be configured to 4 values depending on attended rendering :\n\n - `none` : No cropping, no resize. Will render image with original file dimensions.\n - `cropped` : Crop the rendered image to be exactly dimensions defined in configuration.\n - `height` : Resize the image without distortion to have height to value defined in configuration.\n - `width` : Resize the image without distortion to have width to value defined in configuration.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffemtopixel%2Fcrop","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffemtopixel%2Fcrop","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffemtopixel%2Fcrop/lists"}