Page MenuHomePhabricator

[Reparaturhilfe] Investigate Rotatebot
Closed, ResolvedPublic

Description

Issue

The tool can only rotate JPG and JPEG files, the user also wants to rotate TIFF files. See also the original user request.

Task

We want to investigate if adding support for TIFF files would be an easy change. Otherwise we can not develop new features.

Findings

Summary: The code that the rotationbot is using for rotating PNG files can also be used for rotating TIFF files. Since the maintainer of the code also seems to be active, they could implement this feature on their own. We can bring the request to their attention. It might also be good to create some feature requests to solve the general image rotation issue in a more central way, since it is a well used feature and the bot is not completely dependable.

About the tool

The code

  • Github: rotbot.php
  • Command for rotating JPG/JPEG (see code): jpegtran -rotate $sourceName
  • Command for rotating PNG and GIF (see code): convert $sourceName -rotate
  • ImageMagick (convert) can also be used for TIFF files.

General context

Next steps

Event Timeline

Some review notes:

  • rotatebot's backend uses ExifTool which claims to support TIFF natively, so adding support should be a matter of adding the filetype to existing clauses.
  • TIFF can be rotated by 90° increments by manipulating the Orientation tag so no bit arithmetic would be needed for these cases.
  • UploadWizard and VisualEditor run on the MediaWiki app server which can be assumed to already have graphicsmagick (or imagemagick) configured (see https://www.mediawiki.org/wiki/Manual:Image_administration ), which can rotate any format of allowed image.

It appears like the tool had support for TIFF, but that was removed in 2023 for unknown reasons: https://github.com/toollabs/Rotatebot/commit/c8792123

I currently don't see a reason why that was disabled. I made a pull request: https://github.com/toollabs/Rotatebot/pull/2