[opensuse-wiki] Transferring images
Hi Guys, I found it particular difficult to transfer images (File:xxx.png). Now the work flow is: *Transfer article. You find missing images *Trace them down 1 by 1 on the old wiki and download them *Upload them 1 by 1 on the new wiki. This is very annoying when transferring articles with multiple screenshots, or Artwork articles (I'm busy with that). This gets also pointed out by others whom I speak on irc. At least for the uploading part I found: http://www.mediawiki.org/wiki/Extension:MultiUpload There are more tastes available in: http://www.mediawiki.org/wiki/Manual:Configuring_file_uploads#Mass_uploading Is it possible to install an extension like this ASAP? I'm still try to work out a script for downloading multiple images at once, to overcome the sub-directory problem. Tried earlier tips form Rajko and Cristian, but it's not working as it should (wget is following a little bit to much). Greetings, Tim -- To unsubscribe, e-mail: opensuse-wiki+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-wiki+help@opensuse.org
Hello, on Mittwoch, 14. Juli 2010, Tim Mohlmann wrote:
I'm still try to work out a script for downloading multiple images at once, to overcome the sub-directory problem. Tried earlier tips form Rajko and Cristian, but it's not working as it should (wget is following a little bit to much).
to get the directory structure: echo 'Image:foo.jpg' | sed 's/^Image://' | md5sum - | sed 's§^\(.\)\(.\).*§\1/\1\2§' Script to download several images (not really tested, but should work): grep ".." imglist.txt | while read file ; do img=$(echo $file | sed 's/^Image://') imgpath=$(echo "$img" | md5sum - | sed 's§^\(.\)\(.\).*§\1/\1\2§') wget "http://old-en.opensuse.org/images/$imgpath/$img" done This will download all files listed in imglist.txt with wget. imglist could look like that: Image:Foo.jpg Bar.jpg <---- Image: is not required (will be cut away anyway) Image:Baz.jpg I assume you know what you are writing into imglist.txt - the script does not have a real protection against funny filenames etc. Most important: you have to use _ instead of spaces (or add another sed ;-) If you prefer to use commandline parameters instead of a file with the filelist, replace the first line with for file in "$@" ; do Regards, Christian Boltz PS: In case you wonder: the "grep .." is a trick to skip empty lines ;-) -- An NT server can be run by an idiot, and usually is. [Tom Holub,a.h.b-o-u] -- To unsubscribe, e-mail: opensuse-wiki+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-wiki+help@opensuse.org
participants (2)
-
Christian Boltz
-
Tim Mohlmann