{"id":15647418,"url":"https://github.com/danmichaelo/croptool","last_synced_at":"2025-07-24T12:34:50.246Z","repository":{"id":11308008,"uuid":"13725357","full_name":"danmichaelo/croptool","owner":"danmichaelo","description":"Tool for cropping images at Wikimedia Commons and other Wikimedia wikis","archived":false,"fork":false,"pushed_at":"2025-02-03T22:23:06.000Z","size":1608,"stargazers_count":51,"open_issues_count":91,"forks_count":25,"subscribers_count":10,"default_branch":"main","last_synced_at":"2025-07-14T06:39:39.283Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://croptool.toolforge.org/","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/danmichaelo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"MIT-LICENSE.txt","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":"2013-10-20T19:33:03.000Z","updated_at":"2025-06-30T16:07:54.000Z","dependencies_parsed_at":"2024-02-03T21:31:16.883Z","dependency_job_id":"4f60251b-f9a0-4db6-84d1-ce7c1093275a","html_url":"https://github.com/danmichaelo/croptool","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/danmichaelo/croptool","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danmichaelo%2Fcroptool","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danmichaelo%2Fcroptool/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danmichaelo%2Fcroptool/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danmichaelo%2Fcroptool/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/danmichaelo","download_url":"https://codeload.github.com/danmichaelo/croptool/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danmichaelo%2Fcroptool/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266844221,"owners_count":23993965,"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-07-24T02:00:09.469Z","response_time":99,"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":[],"created_at":"2024-10-03T12:19:23.377Z","updated_at":"2025-07-24T12:34:50.214Z","avatar_url":"https://github.com/danmichaelo.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"## CropTool\n\n[CropTool](https://croptool.toolforge.org/) is a tool for cropping image files\nat Wikimedia Commons and other Wikimedia sites using the MediaWiki API with OAuth.\n\n* [Help page on Commons](https://commons.wikimedia.org/wiki/Commons:CropTool).\n* [Tool info on WikiTech](https://wikitech.wikimedia.org/wiki/Tool:CropTool)\n\nFeatures:\n\n* Supports JPEG, PNG, SVG and (animated) GIF files, and also single pages from\n  DjVu and PDF files.\n* JPEGs can be cropped either losslessly using [jpegtran](http://jpegclub.org/jpegtran/)\n  or pixel perfect using [ImageMagick](https://www.imagemagick.org/).\n* Crop preview can be initialized from query string parameters:\n  `?title=Example.jpg\u0026left=10\u0026top=10\u0026width=150\u0026height=100`\n  or\n  `?title=Example.jpg\u0026left=10\u0026top=10\u0026right=10\u0026bottom=10`\n* Detects [`{{Remove border}}`](https://commons.wikimedia.org/wiki/Template:Remove_border),\n  [Category:Images with borders](https://commons.wikimedia.org/wiki/Category:Images_with_borders),\n  [`{{Watermark}}`](https://commons.wikimedia.org/wiki/Template:Watermark) and\n  [`{{Trimming}}`](https://commons.wikimedia.org/wiki/Template:Trimming), and\n  provides check boxes for optional removal of these upon cropping.\n* The result can replace the original file or be uploaded as a new one.\n* If the result is uploaded as a new file on Wikimedia Commons,\n  * the `{{Extracted from}}` template is added to the new file, and the\n  `{{Image extracted}}` template is added or updated on the original.\n  * some templates are not copied to the new page: quality assessment templates ([Featured picture](https://commons.wikimedia.org/wiki/Template:Featured picture),\n  [Valued image](https://commons.wikimedia.org/wiki/Template:Valued_image),\n  [Quality image](https://commons.wikimedia.org/wiki/Template:Quality_image),\n  [Picture of the day](https://commons.wikimedia.org/wiki/Template:Picture_of_the_day),\n  [Assessments](https://commons.wikimedia.org/wiki/Template:Assessments)),\n  license review templates and crop tracking templates\n  ([Extracted from](https://commons.wikimedia.org/wiki/Template:Extracted_from)\n  and [Image extracted](https://commons.wikimedia.org/wiki/Template:Image_extracted)).\n* Stops users from cropping images waiting for license review (having\n  [`{{Flickrreview}}`](https://commons.wikimedia.org/wiki/Template:Flickrreview)\n  without any parameters, or some of the `User:FlickreviewR` subtemplates),\n  since images should be reviewed before being altered.\n* Adds [`{{Orphaned non-free revisions}}`](http://en.wikipedia.org/wiki/Template:orfurrev)\n  when cropping non-free media on English Wikipedia.\n\n### Setting up a development environment\n\n1. Request an OAuth 1.0 consumer at https://meta.wikimedia.org/wiki/Special:OAuthConsumerRegistration/propose with\n\n- Callback URL: https://localhost:7878/\n- Allow consumer to specify a callback in requests\n- Grants: \"Edit existing pages\", \"Create, edit, and move pages\", \"Upload new files\" and \"Upload, replace, and move files\"\n\n2. Copy `config.dev.ini` to `config.ini` and add the consumer token and secret token to `config.ini` and check the default paths for the dependencies.\n\n3. Install dependencies using [Composer](https://getcomposer.org/) and [NPM](https://nodejs.org/en/):\n\n```\ndocker compose run phpfpm composer install\nnpm install\n```\n\n4. Build the frontend:\n\n```\nnpx gulp build\n```\n\n5. Generate secret for encrypted cookies:\n\n```\ndocker compose run phpfpm php generate-key.php\n```\n\n6. Start the development server on https://localhost:7878/\n\n```\ndocker-compose up\n```\n\nNote that you should be able to login and preview cropping without waiting for the OAuth consumer to be accepted.\n\n### Deployment notes\n\n* `ssh tools-login.wmflabs.org`\n* `become croptool`\n* `git pull`\n* `toolforge build start https://github.com/danmichaelo/croptool.git`\n* `toolforge webservice --backend=kubernetes --mount=all buildservice restart`\n\nFirst-time setup:\n\n- Copy `config.prod.ini` into the home directory, and add OAuth information\n- Creates a `public_files` directory in the home directory and set it to be readable and writable by others\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanmichaelo%2Fcroptool","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdanmichaelo%2Fcroptool","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanmichaelo%2Fcroptool/lists"}