Mercurial > libervia-backend
comparison sat/plugins/plugin_xep_0264.py @ 3273:4230aaeab9a7
plugin XEP-0231, XEP-0264: fixed some remaining encoding issue following Python 3 port
author | Goffi <goffi@goffi.org> |
---|---|
date | Mon, 18 May 2020 23:39:41 +0200 |
parents | 559a625a236b |
children | 5887fb414758 |
comparison
equal
deleted
inserted
replaced
3272:4c98f4972db5 | 3273:4230aaeab9a7 |
---|---|
129 @param image_uid(unicode): unique id of the image | 129 @param image_uid(unicode): unique id of the image |
130 can be a hash | 130 can be a hash |
131 @param size(tuple(int)): requested size of thumbnail | 131 @param size(tuple(int)): requested size of thumbnail |
132 @return (unicode): unique id for this image/size | 132 @return (unicode): unique id for this image/size |
133 """ | 133 """ |
134 return hashlib.sha256(repr((image_uid, size))).hexdigest() | 134 return hashlib.sha256(repr((image_uid, size)).encode()).hexdigest() |
135 | 135 |
136 def _blockingGenThumb(self, source_path, size=None, max_age=None, image_uid=None): | 136 def _blockingGenThumb(self, source_path, size=None, max_age=None, image_uid=None): |
137 """Generate a thumbnail for image | 137 """Generate a thumbnail for image |
138 | 138 |
139 This is a blocking method and must be executed in a thread | 139 This is a blocking method and must be executed in a thread |