diff --git a/server/szurubooru/func/users.py b/server/szurubooru/func/users.py index 168cc5e..b2151e3 100644 --- a/server/szurubooru/func/users.py +++ b/server/szurubooru/func/users.py @@ -30,7 +30,7 @@ def serialize_user(user, authenticated_user, force_show_email=False): util.get_md5((user.email or user.name).lower()), config.config['thumbnails']['avatar_width']) else: - ret['avatarUrl'] = '%s/avatars/%s.jpg' % ( + ret['avatarUrl'] = '%s/avatars/%s.png' % ( config.config['data_url'].rstrip('/'), user.name.lower()) if authenticated_user.user_id != user.user_id \ @@ -146,7 +146,7 @@ def update_user_avatar(user, avatar_style, avatar_content): image.resize_fill( int(config.config['thumbnails']['avatar_width']), int(config.config['thumbnails']['avatar_height'])) - files.save('avatars/' + user.name.lower() + '.jpg', image.to_jpeg()) + files.save('avatars/' + user.name.lower() + '.png', image.to_png()) else: raise InvalidAvatarError( 'Avatar style %r is invalid. Valid avatar styles: %r.' % ( diff --git a/server/szurubooru/tests/api/test_user_creating.py b/server/szurubooru/tests/api/test_user_creating.py index d92b955..64419a6 100644 --- a/server/szurubooru/tests/api/test_user_creating.py +++ b/server/szurubooru/tests/api/test_user_creating.py @@ -226,4 +226,4 @@ def test_uploading_avatar(test_ctx, tmpdir): user = users.get_user_by_name('chewie') assert user.avatar_style == user.AVATAR_MANUAL assert response['user']['avatarUrl'] == \ - 'http://example.com/data/avatars/chewie.jpg' + 'http://example.com/data/avatars/chewie.png' diff --git a/server/szurubooru/tests/api/test_user_updating.py b/server/szurubooru/tests/api/test_user_updating.py index 40230bb..f11e755 100644 --- a/server/szurubooru/tests/api/test_user_updating.py +++ b/server/szurubooru/tests/api/test_user_updating.py @@ -202,4 +202,4 @@ def test_uploading_avatar(test_ctx, tmpdir): user = users.get_user_by_name('u1') assert user.avatar_style == user.AVATAR_MANUAL assert response['user']['avatarUrl'] == \ - 'http://example.com/data/avatars/u1.jpg' + 'http://example.com/data/avatars/u1.png'