plugins radiocol, xep-0054: better handling of upload errors:
- radiocolSongAdded is now asynchronous - _buildAvatar return a Failure if the image is not readable
This commit is contained in:
parent
5b632eca67
commit
b97f78ca93
1 changed files with 8 additions and 16 deletions
|
|
@ -23,6 +23,7 @@ from twisted.internet.defer import inlineCallbacks, returnValue
|
|||
from twisted.words.protocols.jabber import jid
|
||||
from twisted.words.protocols.jabber.xmlstream import IQ
|
||||
from twisted.words.xish import domish
|
||||
from twisted.python.failure import Failure
|
||||
import os.path
|
||||
|
||||
from zope.interface import implements
|
||||
|
|
@ -236,7 +237,7 @@ class XEP_0054(object):
|
|||
try:
|
||||
img = Image.open(filepath)
|
||||
except IOError:
|
||||
raise exceptions.DataError("Can't open image")
|
||||
return Failure(exceptions.DataError("Can't open image"))
|
||||
|
||||
if img.size != (64, 64):
|
||||
img = img.resize((64, 64))
|
||||
|
|
|
|||
Loading…
Reference in a new issue