Page MenuHomePhabricator

Request for functionality: server-side cropping of images for commons
Open, LowPublic

Description

I like to provide historical maps in my Polish Wikipedia articles. In particular, I often need small fragments of complete maps.

An example is the map of the destruction of Warsaw during WW2 [[:commons:File:Zniszczenia.jpg]] of size 18,588 × 23,976 px, 84.64 MB.

In a typical article [[:w:pl:Ulica Olszowa w Warszawie]] about a single street, I need only a small fragment of the complete map. Therefore I had to create a new file on commons with the selection I needed: [[:commons:File:Zniszczenia Warszawy, fragment Pragi.jpg|]].

It seems reasonable to design a mechanism which would enable me, on my Wikipedia, to specify a fragment of the complete map to be imported from commons and displayed in the article. It would stop the proliferation of redundant images on commons, being crops of one another.

I am aware of [[:en:Template:CSS image crop]]. However, this tool downloads the complete image and performs crop on the client side. Given the size of the complete image, it is prohibitive for users of low-end devices and/or slow networks. So it seems reasonable that the crop is performed on the server side.

In order to reduce the computational overhead, I expect that a cache of frequently requested crops should be created.

Summing up, the requested functionality:

  1. The tool is installed on commons and working on the server side.
  2. It produces crops of images, as specified in the link from Wikipedia.
  3. It delivers the cropped images to the Wikipedia
  4. Perhaps it should cache frequently produced crops.

See Also:
T9757: allow cropping images when rendered

Event Timeline

Not exactly. The author of T67284: Insert cropped image from Scan is concerned with the procedure of choosing the right fragment of the picture to be cropped. She/he is willing to use [[:en:Template:CSS image crop]] and wants to be able to choose the fragment to be cropped from proofreading tools. That's reasonable.

My point is that there are very large pictures (about 85 MB in my example), for which [[:en:Template:CSS image crop]] is impractical. It executes the crop by means of CSS on the client device, which might be a small mobile, not capable of processing so large a file. So what I am suggesting is a server-side variant of [[:en:Template:CSS image crop]], which crops the image on the commons server, before serving it to the client.

dr0ptp4kt moved this task from Untriaged to Needs Design on the Multimedia board.
dr0ptp4kt added a project: ImageTweaks.
dr0ptp4kt subscribed.

Presently we're not working on ImageTweaks, but I've modified this task to be part of that project for some future date. This will require further investigation from a UX perspective when that time comes.