(Go: >> BACK << -|- >> HOME <<)

Page MenuHomePhabricator

Look into issues with Crop Tool
Closed, ResolvedPublic

Description

A wish from the Reparatursommer board. ( See wiki )

CropTool is a MediaWiki tool for cropping images at Wikimedia Commons and other Wikimedia sites. It supports JPEG, PNG, TIFF and (animated) GIF files, and can also extract single pages from DJVU and PDF files as JPEG for cropping.

Users have been reporting issues with the tool:

  • Large or small images not able to be published with certain rotation angles
  • Error messages appearing when clicking on the 'Publish' button after a certain amount of time spent on the site
  • The 'lossless' crop mode not always applied when selected
  • Cropping of certain file formats not possible (TIFF, WEBP, PDF)

Resources:

Patches for reviews:

Event Timeline

The code is really well written and structured, so after looking into it for a bit I got confident, that we can address some issues and provide fixes.

I list a few things I see

  • The setup is a bit broken, with some configuration overrides not setup by default ( more a dev env problem but still )
  • The JpegFile class is broken at the crop part due to an unclean conversion to a static method static. - That's not an issue in production though because:
  • The JpegFile, PngFile and probably also GifFile sub classes are never used for file operations it seems. There's just always the plain File class used. This seems be responsible for a set of problems there. The split into these classes is a result of a refactoring that took place in 2020 and was never really fixed. See also the post on the discussion page where that was highlighted Lossless mode no longer working?.

At least these three things seem to be fixable and would repair some parts of the workflow. We only would need help to merge and deploy the code from the current maintainer.

Tagging WMDE-TechWish as this open task has no other active project tags

The main issue reported here got fixed by merging and deploying of pull request on GitHub. We will also not further work on this, so I'll mark this ticket as resolved and close it.