Page MenuHomePhabricator

Accept alternative image URLs
Open, LowPublic

Description

We should be liberal about accepting file URLs which might not be in the usual, canonical format. Basically, we should let the users paste links from any workflow ehere you might "copy image link" or copy from the location bar. For example,

Event Timeline

awight created this task.Mar 30 2019, 4:21 PM
Restricted Application added a project: archived--TCB-Team. · View Herald TranscriptMar 30 2019, 4:21 PM
thiemowmde triaged this task as Low priority.May 14 2019, 1:48 PM
thiemowmde moved this task from Backlog to prio 2 tickets on the Move-Files-To-Commons board.
thiemowmde added subscribers: thiemowmde, WMDE-Fisch.

That's definitely nice to have. Personally, I support the idea. However, please consider the following:

  • The form to enter a URL is typically not used by users. The only use-case we really care about is the export button on a file page.
  • The more URLs we accept, the more complicated the parser for these URLs becomes.

I'm not saying we should not touch the source URL parser. At the moment it's a very trivial baseline that definitely needs some love. For example, I feel it's critical to make it accept MediaViewer URLs. But we should make sure it doesn't grow out of hand. Again, keep YAGNI in mind.

Can I work on this?

Personally I think yes, you can. We will try to support you as good as we can. A few things to consider:

  • Please keep patches small and try to fix or change one thing at a time. For example, you can try to focus on MediaViewer URLs first.
  • Please note we are probably not going to accept patches without tests in the FileImporter codebase. However, it's fine to start with a prove-of-concept patch that doesn't have tests, if you plan to add tests later.

Thanks, and have fun!

awight added a comment.Mon, Nov 2, 9:05 AM

Hi, I wanted to also highlight this comment from above,

  • The form to enter a URL is typically not used by users. The only use-case we really care about is the export button on a file page.

We should identify actual use cases where the form is used, rather than supporting things that might not happen. I can imagine some non-Wikimedia sites might prefer this manual style for import, but we should collect those stories here. These sites may also have special URL structures that should be handled by configurable parsing, etc.