{"id":36398513,"url":"https://github.com/spiral-modules/cropper","last_synced_at":"2026-01-11T16:01:35.595Z","repository":{"id":57056835,"uuid":"49001660","full_name":"spiral-modules/cropper","owner":"spiral-modules","description":"Image cropper virtual tag for spiral forms (dark templates)","archived":false,"fork":false,"pushed_at":"2016-03-03T09:40:56.000Z","size":523,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2023-08-05T00:05:31.921Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/spiral-modules.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-01-04T14:22:44.000Z","updated_at":"2016-01-12T19:58:52.000Z","dependencies_parsed_at":"2022-08-24T14:52:59.339Z","dependency_job_id":null,"html_url":"https://github.com/spiral-modules/cropper","commit_stats":null,"previous_names":[],"tags_count":23,"template":null,"template_full_name":null,"purl":"pkg:github/spiral-modules/cropper","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spiral-modules%2Fcropper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spiral-modules%2Fcropper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spiral-modules%2Fcropper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spiral-modules%2Fcropper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/spiral-modules","download_url":"https://codeload.github.com/spiral-modules/cropper/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spiral-modules%2Fcropper/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28312083,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-11T14:58:17.114Z","status":"ssl_error","status_checked_at":"2026-01-11T14:55:53.580Z","response_time":60,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2026-01-11T16:00:40.143Z","updated_at":"2026-01-11T16:01:35.550Z","avatar_url":"https://github.com/spiral-modules.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Image Cropper Widget\nModule provides ability to crop user image on client side and send to backend as file stream over ajax call.\n\n## Usage Example\n\nAt frontend (dark template required), simply add virtual tag to your form:\n\n```html\n\u003cdark:use bundle=\"spiral:cropper-bundle\"/\u003e\n...\n\u003cform.cropper label=\"Image Cropper\" name=\"image\" data-preview=\"#cropper-preview\"/\u003e\n```\nThe code above will be transformed into html and will add required javascript. Result html:\n\n```html\n\u003clabel class=\"item-form item-file\"\u003e\n    \u003cspan class=\"item-label\"\u003eImage Cropper\u003c/span\u003e\n    \u003cinput type=\"file\" class=\"item-input js-sf-cropper\" data-filename-selector=\".sf-crop-filename\" data-name=\"image\"\n           context=\"\" data-preview=\"#cropper-preview\"\u003e\n    \u003cspan class=\"sf-crop-filename btn\"\u003eChoose a file...\u003c/span\u003e\n\u003c/label\u003e\n```\n\nBackend:\n```php\npublic function uploadAction()\n{\n    $image = $this-\u003einput-\u003efile('image');\n    //...\n}\n```\n\nCropper preview:\n\n![cropper-preview](https://cloud.githubusercontent.com/assets/12486924/12550729/ad25ddd8-c376-11e5-80c8-bfba0eba4251.jpg)\n\n\n## Options\n* **wrapper-class** - pass a class to wrapper\n* **label** - file-input label\n* **label-class** - pass a class to file-input label\n* **placeholder** - text to pass to filename-container\n* **placeholder-class** - pass a class to filename-container\n* **data-format** - how to send data: cropped or full size with coordinates to crop on server *Default: \"cropped\" Optional: \"full\"*\n* **data-ajax-image** - preloading of image through ajax request *Default: \"false\" Optional: url of image to preload*\n* **data-template** - pass custom html template of cropper\n* **data-ajax-address** - request address for submitting (if there is no form) *Default: \"false\" Optional: request URL*\n* **data-ratio** - locked aspect ratio *Default: false*\n* **data-filename-selector** - node selector to place filename. If starts with space - global search of node (document) otherwise inside the node (if the node is input, then from parent node)\n* **data-info** - what info to show *Default: [] Example: \u003c/b\u003e data-info=\"ratio,origSize,croppedSize\"*\n* **data-preview** - selector of preview element *Default: \"\"*\n* **data-save-btn-text** - save button text *Default: \"Save\"*\n* **data-close-btn-text** - save button text *Default: \"Close\"*\n* **data-custom-btn-class** - pass custom class to btns *Default: \"\"*\n* **data-adjust** - selector of element which triggers crop-modal *Default: \"\"*  If starts with space - global search of node (document) otherwise inside the node (if the node is input, then from parent node)\n\n## Installation\n\n`composer require spiral/cropper`  \n`spiral register spiral/cropper`\n\n## Update\n`composer update spiral/cropper`  \n`spiral publish spiral/cropper`\n\n\n## License\n\nCopyright (c) 2016 Alex Chepura, Yauheni Yasinau and contributors. Released under an [MIT license](https://github.com/spiral-modules/image-cropper/blob/master/LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspiral-modules%2Fcropper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fspiral-modules%2Fcropper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspiral-modules%2Fcropper/lists"}