From 3e12a769fd3c23532722409ab13d5d9ba251945b Mon Sep 17 00:00:00 2001 From: Jochen Topf Date: Wed, 9 Jan 2013 21:39:39 +0100 Subject: Improve thumbnail format detection --- sources/wiki/get_image_info.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'sources/wiki') diff --git a/sources/wiki/get_image_info.rb b/sources/wiki/get_image_info.rb index 06707ca..a6756e1 100755 --- a/sources/wiki/get_image_info.rb +++ b/sources/wiki/get_image_info.rb @@ -63,7 +63,7 @@ until image_titles.empty? # puts some_titles.join(",") + "\n" begin - data = api.query(:prop => 'imageinfo', :iiprop => 'url|size|mime', :titles => some_titles.join('|'), :iiurlwidth => 200, :iiurlheight => 200) + data = api.query(:prop => 'imageinfo', :iiprop => 'url|size|mime', :titles => some_titles.join('|'), :iiurlwidth => 10, :iiurlheight => 10) if !data['query'] STDERR.puts "Wiki API call failed (no 'query' field):" @@ -93,6 +93,7 @@ until image_titles.empty? else prefix = nil suffix = nil + puts "Wrong thumbnail format: '#{info['thumburl']}'" end db.execute("INSERT INTO wiki_images (image, width, height, size, mime, image_url, thumb_url_prefix, thumb_url_suffix) VALUES (?, ?, ?, ?, ?, ?, ?, ?)", v['title'], -- cgit v1.2.3