Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
This branch is 103 commits behind danmichaelo:master.

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time


CropTool is a tool for cropping image files at Wikimedia Commons and other Wikimedia sites using the MediaWiki API with OAuth. Help page on Commons.

Setting up a development environment

The easiest way to setup a development environment is by using Vagrant. If you have Vagrant installed, just type

vagrant up

This will create a virtual machine with the static IP (you can change this in the Vagrantfile if needed). To test the MediaWiki OAuth authentication, you can redirect to your newly created virtualbox machine by adding an entry to your /etc/hosts file:

If you then visit in your browser, the content will be fetched from your virtualbox machine. The Vagrant provisioner has generated a self-signed certificate, so https will work, but the browser will of course warn you about the certificate being self-signed.

Of course you need to remember to remove the entry from /etc/hosts when you're done testing.

Setting up a lightweight development environment

As a lightweight alternative for a development environment, we provide a Caddyfile which is meant to be used with Caddy. This allows to do frontend development without the need to boot a virtual machine.

  1. Run caddy in the source directory
  2. Add to your /etc/hosts
  3. Open and accept the certificate warning (since we issue a self-signed certificate)

Deployment notes

To get jpegtran, we fetch the latest from the Independent JPEG Group. Note that the server returns "403 Forbidden" if you use the default curl user agent string.

curl -A "CropTool/0.1 (" "" | tar -xz
cd jpeg-*
make test

Download deps and configure croptool:

  1. composer install --optimize-autoloader
  2. cp config.dist.ini config.ini and insert OAuth info and the path to jpegtran.
  3. Check that the server can write to logs and public_html/files.
  4. vendor/bin/phpunit
  5. crontab to setup cronjobs.
  6. npm install
  7. gulp build
  8. php generate-key.php


Tool for cropping images at Wikimedia Commons and other Wikimedia wikis






No releases published


No packages published


  • PHP 65.4%
  • HTML 15.8%
  • JavaScript 15.3%
  • CSS 1.7%
  • Shell 1.4%
  • Python 0.4%