http://www.mediawiki.org/wiki/Special:Code/pywikipedia/11707
Revision: 11707 Author: drtrigon Date: 2013-07-01 21:33:58 +0000 (Mon, 01 Jul 2013) Log Message: ----------- bug fix; solve IndexError: index 0 is out of bounds for axis 0 with size 0 bug fix; solve TypeError: argument of type 'float' is not iterable
Modified Paths: -------------- trunk/pywikipedia/catimages.py
Modified: trunk/pywikipedia/catimages.py =================================================================== --- trunk/pywikipedia/catimages.py 2013-07-01 13:04:55 UTC (rev 11706) +++ trunk/pywikipedia/catimages.py 2013-07-01 21:33:58 UTC (rev 11707) @@ -199,10 +199,10 @@ misc += [exif['DescProducer']] if 'DescProducer' in exif else [] misc += [exif['DescCreator']] if 'DescCreator' in exif else []
- result = { 'Software': exif['Software'] if 'Software' in exif else u'-', - 'Desc': exif['Desc'] if 'Desc' in exif else u'-', - 'Comment': exif['Comment'] if 'Comment' in exif else u'-', - 'Producer': exif['Producer'] if 'Producer' in exif else u'-', + result = { 'Software': u'%s'%exif['Software'] if 'Software' in exif else u'-', + 'Desc': u'%s'%exif['Desc'] if 'Desc' in exif else u'-', + 'Comment': u'%s'%exif['Comment'] if 'Comment' in exif else u'-', + 'Producer': u'%s'%exif['Producer'] if 'Producer' in exif else u'-', 'Misc': u'\n'.join(misc) if misc else u'-',} #'Output_Extension': exif['Output_extension'] if 'Output_extension' in exif else u'-', #'DescProducer': exif['DescProducer'] if 'DescProducer' in exif else u'-', @@ -1033,6 +1033,7 @@ enable_recovery() # enable recovery from hard crash found = list(hog.detectMultiScale(img, 0.25, (8,8), (32,32), 1.05, 2)) disable_recovery() # disable since everything worked out fine + found = [item for item in found if item]
# people haar/cascaded classifier # use 'haarcascade_fullbody.xml', ... also (like face detection)
pywikipedia-svn@lists.wikimedia.org