Page MenuHomePhabricator

Wrong imageinfo reported
Closed, ResolvedPublic

Description

Author: volker.haas

Description:
The imageinfo reported by the API is wrong if an unrelated image is added to the query URL. This happens on de.wikipedia.

Compare the two urls below - the first URL returns the correct imageinfo for the Image "Datei:Zoe Gräfin Wassilko 1918.jpg", the second one does not:

url 1:

http://de.wikipedia.org/w/api.php?format=jsonfm&action=query&iiurlwidth=1200&iiprop=url|user|comment|url|sha1|size&prop=imageinfo|info&inprop=url&titles=Datei:Jordaki+Baron+Wassilko+von+Serecki+1855.jpg|Datei:Victor+Graf+Wassilko+v.+Serecki+1895.jpg|Datei:Stammwappen+Wassilko%2C+1676.jpg|Datei:Zoe+Gr%C3%A4fin+Wassilko+1918.jpg|Datei:Schloss+Berhometh+1905.jpg|Datei:Dokument+von+1428.jpg|Datei:Stephan+Graf+Wassilko+v.+Serecki+1918.jpg|Datei:Commons-logo.svg|Datei:Alexander+Graf+Wassilko+v.+Serecki+1916%2C+damals+Major.jpg|Datei:Freiherrn+Wassilko+von+Serecki.jpg|Datei:Grafen+Wassilko+von+Serecki.jpg|Datei:Nikolaus+Ritter+von+Wassilko.jpg

url 2:

http://de.wikipedia.org/w/api.php?format=jsonfm&action=query&iiurlwidth=1200&iiprop=url|user|comment|url|sha1|size&prop=imageinfo|info&inprop=url&titles=Datei:Jordaki+Baron+Wassilko+von+Serecki+1855.jpg|Datei:Victor+Graf+Wassilko+v.+Serecki+1895.jpg|Datei:Stammwappen+Wassilko%2C+1676.jpg|Datei:Zoe+Gr%C3%A4fin+Wassilko+1918.jpg|Datei:Schloss+Berhometh+1905.jpg|Datei:Dokument+von+1428.jpg|Datei:Stephan+Graf+Wassilko+v.+Serecki+1918.jpg|Datei:Commons-logo.svg|Datei:Alexander+Graf+Wassilko+v.+Serecki+1916%2C+damals+Major.jpg|Datei:Freiherrn+Wassilko+von+Serecki.jpg|Datei:Grafen+Wassilko+von+Serecki.jpg|Datei:Nikolaus+Ritter+von+Wassilko.jpg|Datei:Wappen+der+Ritter+von+Wassilko+1788.jpg

The only difference between the URLs is the additional image title at the end of url 2.

The relevant (and correct) imageinfo for url 1 is:

			"-4": {
				"ns": 6,
				"title": "Datei:Zoe Gr\u00e4fin Wassilko 1918.jpg",
				"missing": "",
				"imagerepository": "shared",
				"imageinfo": [
					{
						"user": "Sacha47",
						"size": 533162,
						"width": 1692,
						"height": 2332,
						"comment": "",
						"thumburl": "http:\/\/upload.wikimedia.org\/wikipedia\/commons\/thumb\/9\/9f\/Zoe_Gr%C3%A4fin_Wassilko_1918.jpg\/1200px-Zoe_Gr%C3%A4fin_Wassilko_1918.jpg",
						"thumbwidth": 1200,
						"thumbheight": 1654,
						"url": "http:\/\/upload.wikimedia.org\/wikipedia\/commons\/9\/9f\/Zoe_Gr%C3%A4fin_Wassilko_1918.jpg",
						"descriptionurl": "http:\/\/commons.wikimedia.org\/wiki\/File:Zoe_Gr%C3%A4fin_Wassilko_1918.jpg",
						"sha1": "1f090ed26b8eed26d4371f826ae51c532dfd3d9c"
					}
				],
				"fullurl": "http:\/\/de.wikipedia.org\/wiki\/Datei:Zoe_Gr%C3%A4fin_Wassilko_1918.jpg",
				"editurl": "http:\/\/de.wikipedia.org\/w\/index.php?title=Datei:Zoe_Gr%C3%A4fin_Wassilko_1918.jpg&action=edit"
			},

whereas url 2 yields the following, incorrect image info:

			"-4": {
				"ns": 6,
				"title": "Datei:Zoe Gr\u00c3\u00a4fin Wassilko 1918.jpg",
				"missing": "",
				"imagerepository": "",
				"fullurl": "http:\/\/de.wikipedia.org\/wiki\/Datei:Zoe_Gr%C3%83%C2%A4fin_Wassilko_1918.jpg",
				"editurl": "http:\/\/de.wikipedia.org\/w\/index.php?title=Datei:Zoe_Gr%C3%83%C2%A4fin_Wassilko_1918.jpg&action=edit"
			},

The different "title" in the response might be a hint to what goes wrong.


Version: 1.20.x
Severity: normal

Details

Reference
bz37021

Event Timeline

bzimport raised the priority of this task from to Low.Nov 22 2014, 12:27 AM
bzimport set Reference to bz37021.
bzimport added a subscriber: Unknown Object (MLST).

In the second one it looks like input is being converted from ISO-8859-1 to UTF-8 (incorrectly so); usually this should only happen if there's a stray 8-bit character in the URL somewhere... not sure why it's kicking in here.

Can't reproduce on a local trunk install; the character in the title makes it through intact and is correctly reported as missing.

(In reply to comment #2)

Can't reproduce on a local trunk install; the character in the title makes it
through intact and is correctly reported as missing.

marking unconfirmed as a result.

Use POST as a simply solution, for the rest see bug 36839

  • This bug has been marked as a duplicate of bug 36839 ***