|
|
@ -389,6 +389,9 @@ function getAvatar(username, img) { |
|
|
|
case 'png/': |
|
|
|
case 'png/': |
|
|
|
data = 'data:image/png;base64,' + window.btoa(data.slice(4)); |
|
|
|
data = 'data:image/png;base64,' + window.btoa(data.slice(4)); |
|
|
|
break; |
|
|
|
break; |
|
|
|
|
|
|
|
case 'gif/': |
|
|
|
|
|
|
|
data = 'data:image/gif;base64,' + window.btoa(data.slice(4)); |
|
|
|
|
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
_avatarMap[username] = data; |
|
|
|
_avatarMap[username] = data; |
|
|
|
img.attr('src', data); |
|
|
|
img.attr('src', data); |
|
|
@ -400,10 +403,13 @@ function getAvatar(username, img) { |
|
|
|
if (imagedata !== 'img/genericPerson.png') { |
|
|
|
if (imagedata !== 'img/genericPerson.png') { |
|
|
|
if (imagedata.substr(0, 27) === 'data:image/jpeg;base64,/9j/') |
|
|
|
if (imagedata.substr(0, 27) === 'data:image/jpeg;base64,/9j/') |
|
|
|
_putResourceIntoStorage('avatar:' + username, 'jpg/' + window.atob(imagedata.slice(27))); |
|
|
|
_putResourceIntoStorage('avatar:' + username, 'jpg/' + window.atob(imagedata.slice(27))); |
|
|
|
else if (imagedata.substr(0, 22) === 'data:image/png;base64,') |
|
|
|
else { |
|
|
|
_putResourceIntoStorage('avatar:' + username, 'png/' + window.atob(imagedata.slice(22))); |
|
|
|
var s = imagedata.substr(0, 22); |
|
|
|
else |
|
|
|
if (s === 'data:image/png;base64,' || s === 'data:image/gif;base64,') |
|
|
|
_putResourceIntoStorage('avatar:' + username, imagedata); |
|
|
|
_putResourceIntoStorage('avatar:' + username, imagedata.substr(11, 3) + '/' + window.atob(imagedata.slice(22))); |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
_putResourceIntoStorage('avatar:' + username, imagedata); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
req.img.attr('src', imagedata); |
|
|
|
req.img.attr('src', imagedata); |
|
|
|
} |
|
|
|
} |
|
|
|