Last modified: 2011-03-13 18:04:40 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T29917, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 27917 - Keep image links alive after move
Keep image links alive after move
Status: RESOLVED WONTFIX
Product: MediaWiki
Classification: Unclassified
File management (Other open bugs)
unspecified
All All
: Lowest enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-03-07 13:31 UTC by Subfader
Modified: 2011-03-13 18:04 UTC (History)
5 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Subfader 2011-03-07 13:31:13 UTC
$wgAllowImageMoving=true; has a major disadvantage: All hotlinked images die after the image is moved.
But I like to encourage people to hotlink images from my wiki like Commons does with its "use this image on the web" feature.
Therefor I'd like to keep images alive after they're moved.

I see several possible solutions:

1) A global to "don't delete old file and thumbs" = move image page, copy original file AND thumb files. 
I.e. an old unused 300px thumb should also be there after the move.
Problem: Old files are not seperated. This makes "flushing" the current thumbs impossible.

2) /wiki/thumb.php should recognize moved file names. On image pages I use links like thumb.php?w=320&f=Old.jpg as an option to hotlink custom thumb sizes. If Old.jpg is moved to New.jpg, thumb.php?w=320&f=Old.jpg should still work.
Problem: Double redirects.

3) A "use this image on the web" feature copies a selected file to a "static" destination, e.g. a subfolder or a subdomain like static.mywiki.com/images/. The subdomain variation could use the same hash directory structure.
Problem: Activating the copy action via link on the image page. Javascript?
Comment 1 db [inactive,noenotif] 2011-03-07 19:48:09 UTC
Leave the redirect at the old file name works fine...
Comment 2 Subfader 2011-03-08 00:57:04 UTC
I talk about hotlinked images. Those do not work after the image move.
Comment 3 Bawolff (Brian Wolff) 2011-03-08 02:30:57 UTC
I Imagine it'd be fairly easy to do option 2 (thumb.php support image redirects). The issue with that is then it becomes inconsistent, with installs using direct links having the direct links not support redirects.

Option 3 seems like the wrong way to do this. For option 1 maybe if it did symbolic links (I don't know enough about how we store files in the filesystem to know if thats a bad idea or not)
Comment 4 Bryan Tong Minh 2011-03-08 08:42:02 UTC
We can support redirects in wikimedia's webstore backend
Comment 5 Krinkle 2011-03-08 10:16:22 UTC
Hotlinking should be done through Special:FIlePath as of 1.17

http://commons.wikimedia.org/wiki/Special:FilePath?file=Sample.jpg&width=20

This also supports redirects
Comment 6 Krinkle 2011-03-08 10:17:39 UTC
Addndm:

Hotlinking to the raw path is always a bad idea and should not be encoured, for all you know you may want to migrate to a seperate server/subdomain for storing media, or perhaps enable/disable md5-paths at which points stuff will break again.
Comment 7 Krinkle 2011-03-08 10:30:36 UTC
I think there's a duplicate of this bug (can't find it), but I remember there Roan mentioned something about cache and thumb.php afaik it caches less or not at all. thumb.php is not meant to be referenced directly in the front-end.
Comment 8 Subfader 2011-03-08 11:40:08 UTC
Thanks for http://commons.wikimedia.org/wiki/Special:FilePath?file=Sample.jpg&width=20
didn't know that option.

Meanwhile I created option 3) myself without javascript and a php script in the destination folder. It saves the file via /wiki/thumb.php.

Main advantage: File stays 100% the same version after re-uploading.
Comment 9 Subfader 2011-03-08 12:46:34 UTC
**Main advantage: File stays 100% the same version after page move, re-uploading, or deletition.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links