This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "emacs-jabber".
The branch, master has been updated
via 2810cac3780f7e2fec3d43264699aca3473951d4 (commit)
from 3bf076485b3cee64645af673da132dc46f68cbfd (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 2810cac3780f7e2fec3d43264699aca3473951d4
Author: Alex Ott <al...@gm...>
Date: Wed Oct 24 08:44:54 2012 +0200
guard create-image with error handler
diff --git a/jabber-avatar.el b/jabber-avatar.el
index 2b45ce3..3f0d73a 100644
--- a/jabber-avatar.el
+++ b/jabber-avatar.el
@@ -95,7 +95,9 @@ If MIME-TYPE is not specified, try to find it from the image data."
(sha1-sum (sha1 data))
(base64-data (or base64-string (base64-encode-string raw-data)))
(type (or mime-type
- (cdr (assq (get :type (cdr (create-image data nil t)))
+ (cdr (assq (get :type (cdr (condition-case nil
+ (create-image data nil t)
+ (error nil))))
'((png "image/png")
(jpeg "image/jpeg")
(gif "image/gif")))))))
@@ -114,13 +116,15 @@ If MIME-TYPE is not specified, try to find it from the image data."
(defun jabber-avatar-image (avatar)
"Create an image from AVATAR.
Return nil if images of this type are not supported."
- (create-image (with-temp-buffer
- (set-buffer-multibyte nil)
- (insert (avatar-base64-data avatar))
- (base64-decode-region (point-min) (point-max))
- (buffer-string))
- nil
- t))
+ (condition-case nil
+ (create-image (with-temp-buffer
+ (set-buffer-multibyte nil)
+ (insert (avatar-base64-data avatar))
+ (base64-decode-region (point-min) (point-max))
+ (buffer-string))
+ nil
+ t)
+ (error nil)))
(defun jabber-avatar-compute-size (avatar)
"Compute and set the width and height fields of AVATAR.
@@ -190,7 +194,10 @@ AVATAR may be one of:
(setq image (lambda () (jabber-avatar-image avatar))))
((stringp avatar)
(setq hash avatar)
- (setq image (lambda () (create-image (jabber-avatar-find-cached avatar)))))
+ (setq image (lambda ()
+ (condition-case nil
+ (create-image (jabber-avatar-find-cached avatar))
+ (error nil)))))
(t
(setq hash nil)
(setq image #'ignore)))
-----------------------------------------------------------------------
Summary of changes:
jabber-avatar.el | 25 ++++++++++++++++---------
1 files changed, 16 insertions(+), 9 deletions(-)
hooks/post-receive
--
emacs-jabber
|