ocarina: Catch exception on empty album art file

I don't want to set the image to an empty file.  Improving the cache so
that it doesn't store empty files is the best solution, so for now I
just check the error (and keep the function from uninviting itself from
the POSTGETART event)
This commit is contained in:
Bryan Schumaker 2011-04-24 09:18:44 -04:00
parent 29a47e84ad
commit a4d27d0b0f

View File

@ -14,7 +14,10 @@ def find_new_width(buf, new_h):
return (float(w) / float(h)) * new_h
def resize(img, new_h):
buf = img.get_pixbuf()
try:
buf = img.get_pixbuf()
except Exception, e:
return
if buf == None:
return
new_w = find_new_width(buf, new_h)