From Wikimedia Commons, the free media repository
Jump to: navigation, search

This is a user subpage containing notes about my edits on Commons.


Read all the friendly manuals in the Editor's index to Wikipedia under en:WP:EIW#Commons, and in the Editor's index to Commons.

Helping to arrange other people's photos[edit]

Categorizing wind power photos[edit]

10:17, 28 November 2008 (UTC): I further categorized many photos that were in these categories:

by categorizing photos by country ("Wind power in ..."), or in some cases by wind turbine manufacturer. Some photos have little or no descriptive information, however, making it difficult to guess where the photographers took them.

One way to get clues is to search for a photo on multiple Wikipedias, and see if the originating Wikipedia has more information not in the photo description page, such as in a photo caption. Here is one instance:

05:23, 8 August 2009 (UTC): try HotCat. See if it will let me painlessly categorize the several dozen images I uploaded such as File:Illinois wind resource map 50m 800.jpg into corresponding categories such as Category:Maps of Illinois. 05:57, 8 August 2009 (UTC): I categorized or recategorized some image files. It wasn't as bad as editing the categories by hand, but it was still some work.

Uploading my own photos[edit]

  • When I take some.

Uploading photos from Flickr[edit]

Flickr has some interesting photos. Determine the procedure for uploading them (see User:File Upload Bot (Magnus Manske) for clues). For example, Flickr has a clearer version of an existing photo on Commons:

03:33, 14 December 2008 (UTC): I wrote some notes about my upload adventures on my Wikipedia user subpage: en:User:Teratornis/Notes#Flickr.

List of photos to upload[edit]

06:47, 24 January 2009 (UTC): here is a partial working list of photos I might upload sooner or later.

Toolserver :: ~bryan :: Flickr web tools[edit]

See my earlier notes in: en:User:Teratornis/Notes#Toolserver :: ~bryan :: Flickr web tools. For some reason, bryan's upload tool only worked on one out of four or five photos I tried to upload with it.

19:01, 15 June 2009 (UTC): I have been using Flinfo to upload photos from Flickr because it's the only method that has worked reliably for me so far. But the Flinfo method can be tedious because I have to download a copy of the photo from Flickr and then manually upload it to Commons.

00:50, 15 August 2009 (UTC): see User:Bryan/Flickr maintainer. It might be interesting to study his code, but I would have to learn Python.

Improving the efficiency of the Flinfo method[edit]

08:44, 15 July 2009 (UTC): I slightly improved the efficiency of the Flinfo method for uploading photos from Flickr, by making the {{Flinfo}} template. That lets me copy just the Flickr ID number into a template, which generates links I can click. My goal is to minimize the number of copy, browser tab switch, and paste steps. It is particularly inefficient to have to fill out individual form fields.

Flinfo in its current form provides no efficient way to customize three items before the first Flinfo call:

  • The photo file name. Since the user has to download a copy of the Flickr file, and then specify the filename on Commons to upload to, it would be nice to do this in one step, before calling Flinfo.
  • The description. The Flickr description usually requires editing for the photos I upload. I can do this after uploading, of course, but that is obtuse, particularly when I'm uploading a group of related photos that will have some or all of their descriptions in common. For example, if a photoset contains multiple photos of a particular wind farm (or any other object), the Flickr user might describe only the first photo in the set coherently, and for the following photos mention some isolated comment about a particular generic feature that doesn't define what the photo is from. That is, the Flickr user assumes the person viewing the photo will view it as part of the set and will understand the context of the photo. That breaks when we upload the photo to Commons and users will see it in isolation.
  • Categories. Flinfo tries, but rarely chooses the best categories. Again, the user can edit the categories after uploading, or in the upload form, but that becomes painful when uploading many photos from a photoset, or related photos from a {{Flickr free}} search. For example, if I upload 15 photos from the same wind farm, all of them will need some or all categories in common. It is very tedious to have to chase the photos around in multiple browser tabs to edit their categories. It would be much better to edit the categories ahead of the Flinfo call for each photo.

Determine whether Flinfo has any URL parameters that will let me specify the file name, description, and categories for Flinfo to use. The terse documentation in User:Flominator/Flinfo says nothing about that. 20:55, 18 July 2009 (UTC): I asked User:Flominator who will consider adding these features:

Another problem is that the "Download original size" link on the Flinfo output page always seems to be broken for me. I cannot recall seeing one that actually links to the original size of any Flickr photo I have tried. I always have to click multiple times to follow the Flickr links to get to the original size, and then save the photo manually to my hard drive. I noticed once that I accidentally saved a not-largest size of a photo and uploaded that, then a bot program came along later and fixed it by automatically uploading the largest size of the Flickr photo. If I could count on that occurring every time, then I might be tempted to save the Flickr default size, thereby avoiding some distracting and fatiguing clicks.

For example, for this photo:

the Flinfo result page is:

which displays the link:

which always redirects to:

The actual largest size is here:

What I would like to do:

  • Modify {{Flinfo}} to accept a file name, description field, and one or more categories. Then I could edit a list of {{Flinfo}} calls on a user subpage which would get me pretty close to being able to just click through the resulting links one by one. I would still have to copy the filename for each photo so I could save it to disk. But I wouldn't have to paste or further edit the description and categories in the upload form, since Flinfo would produce what I want directly, and pass it to the upload form.

However, that may not happen soon, so see if I can just slightly reduce the tedious repetitive editing neccessary to convert a Flickr photo link to the links I am using now. My current procedure:

  1. Run a {{Flickr free}} search to find some photos I want to upload to Commons.
  2. For each photo I like, copy its URL to a user subpage.
  3. Copy the Flickr photo ID out of the URL and paste it into a {{Flinfo}} template call.

To-do: write out the rest of my rather circuitous procedure. See my Help desk message where I mention this. Clean this up:

  1. Browse through some Flickr search results from {{Flickr free}} (a template that generates a link to search for freely licensed photos on Flickr).
  2. When I find a photo I want to upload to Commons, I copy its URL to my user subpage.
  3. Copy the Flickr ID number from the URL, and put it into a {{Flinfo}} call to generate the links in the second line above.
  4. Make a filename for the photo. I like to put the Flickr ID into the filename after some descriptive text; this way I can distinguish multiple photos of the same subject, which are common on Flickr.
  5. Save the file from Flickr to my local disk under this name.
  6. Right-click the Flinfo link in the second line to open Flinfo's output in a new browser tab.
  7. Right-click the simple upload form link to open that in another tab.
  8. Copy the Flinfo output to the simple upload form, and select my saved file to upload.
  9. Edit the Flinfo output in the simple upload form, preview, then upload.

Modify Template:Flinfo[edit]

08:59, 27 September 2009 (UTC): some time ago, User:Flominator added some features I requested to his Flinfo tool. Edit the {{Flinfo}} template to use them. See: User:Flominator/Flinfo#Input parameters. Example URL:

Test my changes in a sandbox template. See these manuals to remind myself how to make conditional expressions in a template:

Some tests:

My test worked. Update Template:Flinfo/doc with the new Flinfo parameters. Now I can almost automate my Flickr uploads, if I write a Perl script that will download a bunch of photos from Flickr and write the {{Flinfo}} calls I need to upload each of them with just a few clicks (and not much more repetitive copy and paste editing). I still have to tell the upload form the name of the file to upload. That will be the one remaining copy and paste that I don't know how to eliminate yet. Other than to use a bot program. I like the semi-manual method, so I can see what I'm doing with each upload. I wouldn't want to do a batch upload and have something go wrong that would require tedious repair for dozens of files.

08:57, 28 September 2009 (UTC): one more problem I noticed: when any of the three optional fields are non-null, the {{Flinfo}}'s default recommendation to open the simple upload form is no longer valid. Presumably the user will want to open the upload form from Flinfo's link, which will pre-fill the upload form with the values that the user specified. I adjusted the text that the template displays.

sed commands[edit]

For now, play around with some Unix commands to convert a Flickr photo URL into an {{Flinfo}} call and a filename link. That is, start with some wikitext like this:


and turn it into this:

** {{Flinfo|453762032}}
** [[:File:Wind turbines and kitesurfers in Zeeland 453762032.jpg]]

Since I don't have any reasonable way to automatically generate a descriptive filename string such as "Wind turbines and kitesurfers in Zeeland,", the best I can generate automatically would be:

** [[:File: 453762032.jpg]]

which I must then edit, using my knowledge of what the photo contains.

For examples of somewhat similar edits, see:

In this section I have a long list of Flickr URLs:

Copy the wikitext to a text file on my hard drive, and attempt to process it with sed as I outlined above. I will have to skip photosets for now. (Later I might also like to try extracting all the URLs of images in a photoset from the photoset page HTML code.)

I'm trying to match the Flickr photo ID number with a regular expression. It seems to always be a nine or ten digit number, between two slash characters, and at the end of the URL. Before trying a complex regular expression, it's smart to test it on some sample text first:

echo '*' | sed 's/\/\([0-9]\{9,10\}\)\//\/\1\/\n** {{Flinfo|\1}}\n** [[:File: \1.jpg]]/g'

That appears to work in Cygwin:

$ echo '*' | sed 's/\/\([0-9]\{9,10\}\)\//\/\1\/\n** {{Flinfo|\1}}\n** [[:File: \
** {{Flinfo|453762032}}
** [[:File: 453762032.jpg]]

Make sure my command ignores a photoset URL:

echo '*' | sed 's/\/\([0-9]\{9,10\}\)\//\/\1\/\n** {{Flinfo|\1}}\n** [[:File: \1.jpg]]/g'

Yes, when the pattern does not match, the command merely prints the input line.

sed command for a Flickr photoset[edit]

Altamont Pass Wind Farm[edit]

22:37, 17 July 2009 (UTC): In User:Teratornis/Flickr examples#Altamont Pass Wind Farm, I will upload 24 photos from a photoset. The Flickr photoset page has a (rather long) line of HTML code that displays the table of links to Flickr images from their thumbnails. Make a sed command that extracts the URLs from the line and converts them into the style of wikitext that I'm using for my uploads.

The photoset I'm using for my development case is:

It contains a line of HTML code many lines down in the page source with the information I want. Individual photo URLs appear in the HTML code in tags like this:

...<a href="/photos/footloosiety/2758316525/in/set-72157606696957806/" title="Altamont Pass Wind Turbines by footloosiety" class="image_link">...

It seems that once again I'm trying to match a simple pattern. There is too much HTML source code to cram into the command line, so save it to a file (altamont_pass_wind_farm_photoset.html) and run sed on the file.

sed -e's/<img [^>]*>//g' \
-e's/<span [^>]*>//g' \
-e's/<div [^>]*>//g' \
-e's/<\/[^>]*>//g' \
-e's/<a href="\(\/photos\/[^\/]*\/\)\([0-9]\{9,10\}\)[^>]*>/\n* http:\/\/\1\2\/\n** {{Flinfo|\2}}\n** [[:File:Altamont Pass Wind Farm \2.jpg]]\n/g' \
-e's/   *//g' \
-e's/\t*//g' \

The above command appears to work. The trick is to first remove all the HTML tags and closing tags I don't need, then match the <a href=...> tags to extract the Flickr photo IDs, replace with the wikitext I want, then clean up by removing any leftover white space.

I pasted the result into User:Teratornis/Flickr examples#Altamont Pass Wind Farm, and it appears to be exactly as if I edited it all by hand.

With sed, I don't know an easy way to say "Match only this portion, discard the rest". Whatever you don't match, sed prints out by default. Instead I have to match everything and explicitly discard what I don't want. Part of the problem is that the chunk of HTML I am processing is all on one long line. There is probably a cleaner way to do this, but I'm not very good with sed. I could try it with Perl, I suppose. That might be interesting for a comparison. Perl can do more than sed so that would be easier to adapt to new situations.

Another problem is that if you match a pattern that is bigger than one tag, it can match everything between the beginning of the first tag and the end of the last tag. (Which can "eat" the entire input file, and miss all the photo IDs that I want to find.) To avoid running off the end of a tag, match everything up to the end with the pattern:

  • [^>]*>

21:32, 18 July 2009 (UTC): make a sed command that generates a gallery tag for all the photos in a photoset. Then I can add it to User:Teratornis/Gallery after I upload the photos. This should be a straightforward variation on the command I used to generate all the {{Flinfo}} calls and filenames on the first pass.

sed -e's/<img [^>]*>//g' \
-e's/<span [^>]*>//g' \
-e's/<div [^>]*>//g' \
-e's/<\/[^>]*>//g' \
-e's/^/<Gallery>\n/' \
-e's/<a href="\(\/photos\/[^\/]*\/\)\([0-9]\{9,10\}\)[^>]*>/File:Altamont Pass Wind Farm \2.jpg\n/g' \
-e's/   *//g' \
-e's/\t*//g' \
-e's/$/<\/Gallery>/' \

That works.

Scroby Sands Wind Farm[edit]

04:57, 19 July 2009 (UTC): repeat the above procedure for this photoset:

sed -e's/<img [^>]*>//g' \
-e's/<span [^>]*>//g' \
-e's/<div [^>]*>//g' \
-e's/<\/[^>]*>//g' \
-e's/<a href="\(\/photos\/[^\/]*\/\)\([0-9]\{9,10\}\)[^>]*>/\n* http:\/\/\1\2\/\n** {{Flinfo|\2}}\n** [[:File:Scroby Sands Wind Farm \2.jpg]]\n/g' \
-e's/   *//g' \
-e's/\t*//g' \
sed -e's/<img [^>]*>//g' \
-e's/<span [^>]*>//g' \
-e's/<div [^>]*>//g' \
-e's/<\/[^>]*>//g' \
-e's/^/<Gallery>\n/' \
-e's/<a href="\(\/photos\/[^\/]*\/\)\([0-9]\{9,10\}\)[^>]*>/File:Scroby Sands Wind Farm \2.jpg\n/g' \
-e's/   *//g' \
-e's/\t*//g' \
-e's/$/<\/Gallery>/' \

Lynn and Inner Dowsing Wind Farm[edit]

07:12, 20 July 2009 (UTC): repeat the above procedure for this photoset:

As a slight variation on my previous commands, this time I am displaying the generated filename without the File: prefix visible. That will make the filename easier to highlight with the mouse so I can copy it. When I save a local copy of the file, and then open it in the simple Commons upload form, I don't want the File: prefix as part of the filename. Also add a direct link to the largest file size of the image, which looks like this:

I can generate a link to the image page for the original (largest) image size, but I don't see a simple way to generate a link to the image itself. The image has a complex URL with some variable parts that I cannot generate from the information I have to feed sed. Instead I will have to scrape it somehow. See the next section for my notes about that.

sed -e's/<img [^>]*>//g' \
-e's/<span [^>]*>//g' \
-e's/<div [^>]*>//g' \
-e's/<\/[^>]*>//g' \
-e's/<a href="\(\/photos\/[^\/]*\/\)\([0-9]\{9,10\}\)[^>]*>/\n* http:\/\/\1\2\/\n** http:\/\/\1\2\/sizes\/o\/\n** {{Flinfo|\2}}\n** [[:File:Lynn and Inner Dowsing Wind Farm \2.jpg|Lynn and Inner Dowsing Wind Farm \2.jpg]]\n/g' \
-e's/   *//g' \
-e's/\t*//g' \
sed -e's/<img [^>]*>//g' \
-e's/<span [^>]*>//g' \
-e's/<div [^>]*>//g' \
-e's/<\/[^>]*>//g' \
-e's/^/<Gallery>\n/' \
-e's/<a href="\(\/photos\/[^\/]*\/\)\([0-9]\{9,10\}\)[^>]*>/File:Lynn and Inner Dowsing Wind Farm \2.jpg\n/g' \
-e's/   *//g' \
-e's/\t*//g' \
-e's/$/<\/Gallery>/' \

Automatically download Flickr images[edit]

00:51, 21 July 2009 (UTC): if I can automatically download a large set of Flickr images, then I will have a much easier time with uploading them. Here are some example Flickr images:

I can already generate the first two links from the HTML code I feed to sed. However, I don't see a simple way to get the URLs of the images themselves, which I could download with w:cURL or w:Wget. See if I can make a command or command pipeline that gets the image URL. The image URL appears in the page source twice:

<a href="">Download the Original
<p><img src="" /><br /></p>

Parsing that out of the page source with sed would not be too difficult, but this is starting to get complicated. I may have to write a Perl script to handle the download. With my present method, I would have to run one sed script to generate the URLs of the original-size photo pages, run Wget on each one, pipe the output of Wget into another sed command to extract the link to the original photo file, and then run Wget to download each photo to a specific filename. This looks tough to do from the command line. I might have to write a script. The question of course is whether anybody else has already done this.

Anyway, try a test to get the image file URL. Use the - option to download to standard output:

wget --quiet -O - | \
grep "Download the Original" | \
sed -e's/.*<a href="\([^"]*\)".*/\1/'

That gets the URL:

$ wget --quiet -O - | \
> grep "Download the Original" | \
> sed -e's/.*<a href="\([^"]*\)".*/\1/'

Which I can then download to a filename with a command like this:

wget -O 'Lynn and Inner Dowsing Wind Farm 2539632588.jpg' \

That works, but I don't know how I could do all these steps from the command line. I would have to write a script to do the downloading. That wouldn't be too difficult, of course.

06:20, 28 July 2009 (UTC): I wrote a Perl script that downloads all the Flickr original size images from a photoset. It wasn't too hard. The hard part will be getting Flinfo data for each photo, adjusting it the way I want, and constructing a URL to open the Commons simple upload form with values pre-filled.

Opening the simple upload form with pre-filled values[edit]

06:20, 28 July 2009 (UTC): the Flinfo tool has a link to open the simple upload form with pre-filled values. Unfortunately they aren't most of the values I want. I want to specify the source file explicitly, with a local path. I don't see how to do that. Some Googling found a page that might suggest wpUploadFile is the URL parameter to try. So try it and see what happens:

For some reason, none of my attempts to specify a value for the source filename cause anything to appear on the upload form. I'm pretty sure the field name really is wpUploadFile because I see this code in the upload form page source:

<td class='mw-label'>
<label for='wpUploadFile'>Source filename:</label>
<td class='mw-input'>
<input tabindex='1' type='file' name='wpUploadFile' id='wpUploadFile' size='60' />
<input type='hidden' name='wpSourceType' value='file' />

Flickr API[edit]

04:02, 15 August 2009 (UTC): various tools use the Flickr API to get information about photos on Flickr, download photos, etc. This search finds a number of pages on Commons that mention this; I guess the various Flickr tools that Commons users have developed must use the Flickr API:

CPAN has a Flickr::API module for Perl scripts. See:

The Flickr API might be useful in combination with User:Nichalp/Upload script or a variant thereof. Then I might be able to script a fully automatic upload of photos from Flickr to Commons with all the photo information set to what I want on Commons on the first go.

Upload tools[edit]

02:00, 15 August 2009 (UTC): survey what's available.

Uploading images from the U.S. government[edit]

09:19, 9 December 2008 (UTC): my first uploads to commons are some images showing installed wind power capacity for the U.S., from this page on an EERE (U.S. government) site:

This page has some interesting diagrams about offshore wind power and ocean energy:

See User:Teratornis/Gallery#Images from the United States government.

Photos by other people I would like to move to Commons[edit]

The English Wikipedia has instructions: Moving images to Commons.

From the Danish Wikipedia[edit]

The Danish Wikipedia has several photos relating to wind power which are not yet on Commons. One way to find them is to search the Danish Wikipedia for the Danish terms for "wind turbine" and "wind farm", and browse through the articles in the search results to see if any have photos.

English Danish
wind turbine vindmølle
Wind farm vindmøllepark
wind power vindkraft
wind energy vindenergi

Searching for "vindmøllepark":

and related categories:

finds an image not yet on Commons:

I will continue to refine my search methods on the Danish Wikipedia.

From the Italian Wikipedia[edit]

From the English Wikipedia[edit]

04:34, 3 December 2008 (UTC): I moved the above images to Commons (and a lot more; see my notes).


Learn how to do what these people do: Commons:Meet our illustrators.

07:10, 13 April 2010 (UTC): see the entries under COM:EIC#Inkscape, and see User:Teratornis/Inkscape.

X-31 diagram[edit]

Try converting File:111373main X-31 3-view.jpg to File:111373main X-31 3-view.svg as it is a simple black-and-white line drawing which should not be too terribly difficult to vectorize. That will give practice at fitting lines and curves on a vector layer to a raster layer in Inkscape. Inkscape: Guide to a Vector Drawing Program has a tutorial about tracing a bitmap image:

Following the Inkcape tutorial, the steps are:

  • Start Inkscape and set the drawing size.
  • Import the source raster file.
  • Auto trace the diagram in the raster file.
  • Clean up the resulting vector paths.


Start Inkscape and set the drawing size[edit]

The source file pixel dimensions are: 330 × 245 pixels.

  • File -> Document properties -> Page tab -> Custom size; Width=330, Height=245.
  • View -> Zoom -> Page (shortcut: 5)
  • File -> Save as... 111373main_X-31_3-view.svg

It's good to save early and often in Inkscape, because the program can crash.

Import the source raster file[edit]

  • File -> Import
  • Edit the X and Y fields in the tool control bar (with the image selected) to position it at the drawing origin (0,0).

Auto trace the diagram in the raster file[edit]

  • Path -> Trace bitmap
    • This setting produces an OK starting result: Mode -> Since scan -> Brightness cutoff, Threshold: 0.800

I used the option of rounded corners. That produced a very curvy result, which is not a useful scan as the drawing has a number of sharp corners and line intersections. So I tried again with the same brightness cutoff threshold, but with no rounding on the options tab. Specifically I unselected these checkboxes on the options tab of the Trace Bitmap dialog:

  • Smooth corners
  • Optimize paths

The result of that trace looks different, and maybe a little better, but still so far off that I'm not sure if tracing provides any advantage for this diagram, compared to just manually tracing every line and curve by hand.

Clean up the resulting vector paths[edit]

  • Move the source raster to a different layer
    • Layer -> Add layer
      • Layer name: Source raster
      • Position: Below current
    • Select the source raster by clicking with the select tool on a background area (to avoid selecting any paths from the bitmap tracing tool). Confirm the selection by looking at the notification area.
    • Layer -> Move selection to layer below
    • Lock the Source raster layer by clicking on the lock icon in the notification area.
  • Break the path resulting from the scan into smaller paths. Path -> Break apart
    • That splits one path into 101 paths, and fills in all the formerly white interiors with black. Select some paths and turn off their fill. I don't know whether this method of cleaning up a trace is better than manually tracing over the bitmap from scratch. I can try both.


08:07, 8 April 2009 (UTC): experiment with some search forms for Commons. See:

The following search does not seem to work correctly; the prefix=Commons:Help desk parameter shows up in the resulting search URL, but the search results contain pages from all of Commons, not just pages within the set Special:PrefixIndex/Commons:Help desk.

Therefore it looks like Commons does not yet have the new search features. In the meantime, I might want to port w:Template:Google custom to Commons so I can make some useful search links here. But that would be less necessary if Commons is going to get the new Lucene/MediaWiki search features soon.

What camera should I get?[edit]

03:55, 5 July 2009 (UTC): I would like to buy a camera so I can photograph interesting things I see when I ride my bicycle. I know nothing about photography. Therefore, idiot-proof would be nice. I would like something that fits in a jersey pocket, is rugged, and runs on standard rechargeable batteries (such as AA-size NiMH cells). Someone tell me what to buy.

Wind turbines on public display: a gallery page[edit]

05:49, 5 July 2009 (UTC): I'm starting a gallery page in my user space, to move to the main article (gallery) space if I like the way it turns out:

The gallery page will contain pictures from the corresponding category and its subcategories:

For style suggestions, see:

I will follow some of the style in the nice Cloud gallery.

Photos on Facebook[edit]

21:39, 13 August 2009 (UTC): many users on Facebook upload photos. The copyright status of the photos is never clear, as Facebook seems to have no obvious concept of letting users choose licenses that I have seen yet. Facebook seems to cut down the resolution from the originals. For example, here is a photo album of the Changdao Wind Farm:

Other links:

05:20, 7 February 2010 (UTC): some people are lobbying Facebook to get up to speed with free content licensing:


05:20, 7 February 2010 (UTC): I'm investigating the tools that various Commons users use to draw maps. Mapmaking software (other than Inkscape) seems underrepresented in Category:Images by software used. For example, I see no category for Quantum GIS. So make such a category and a template:

Autotranslation looks complicated. The instructions are not clear whether you can make the first instance of a new template with autotranslation. The instructions only talk about adding autotranslation to existing templates. So I will start by making a simple template in English only, and later I or someone else can add autotranslation. Thus I will follow an earlier revision of {{Created with Inkscape}}. I used the {{TemplateBox}} template on Template:Created with Quantum GIS/doc. That's the first time I have used that template. It's handy.

19:02, 8 February 2010 (UTC): the QGIS logo appears to be free content:

so I can upload it to Commons as: File:QGis Logo.png.