From f9377ea698db8f8a4bf9fbdeaa8099fa5ffb7774 Mon Sep 17 00:00:00 2001 From: feruz Date: Sat, 30 Nov 2019 19:31:27 +0200 Subject: [PATCH] increase image sizes for better quality --- src/components/profileEditForm/profileEditFormView.js | 2 +- .../profileSummary/view/profileSummaryView.js | 2 +- src/components/userAvatar/view/userAvatarView.js | 2 +- src/utils/image.js | 10 +++++++--- src/utils/postParser.js | 2 +- 5 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/components/profileEditForm/profileEditFormView.js b/src/components/profileEditForm/profileEditFormView.js index 6a713dfc9..6198dc939 100644 --- a/src/components/profileEditForm/profileEditFormView.js +++ b/src/components/profileEditForm/profileEditFormView.js @@ -47,7 +47,7 @@ const ProfileEditFormView = ({ diff --git a/src/components/profileSummary/view/profileSummaryView.js b/src/components/profileSummary/view/profileSummaryView.js index 41735e82e..61c3223a0 100644 --- a/src/components/profileSummary/view/profileSummaryView.js +++ b/src/components/profileSummary/view/profileSummaryView.js @@ -105,7 +105,7 @@ class ProfileSummaryView extends PureComponent { const isColumn = rowLength && DEVICE_WIDTH / rowLength <= 7.3; const followButtonIcon = !isFollowing ? 'account-plus' : 'account-minus'; - let coverImageUrl = getResizedImage(get(about, 'cover_image'), 400); + let coverImageUrl = getResizedImage(get(about, 'cover_image'), 640); if (!coverImageUrl) { coverImageUrl = isDarkTheme diff --git a/src/components/userAvatar/view/userAvatarView.js b/src/components/userAvatar/view/userAvatarView.js index e56c65a4f..00320b86d 100644 --- a/src/components/userAvatar/view/userAvatarView.js +++ b/src/components/userAvatar/view/userAvatarView.js @@ -54,7 +54,7 @@ class UserAvatarView extends Component { avatarUrl, currentUsername: { name, avatar }, } = this.props; - const imageSize = size === 'xl' ? 'large' : 'small'; + const imageSize = size === 'xl' ? 'large' : 'medium'; let _size; const _avatar = username ? { diff --git a/src/utils/image.js b/src/utils/image.js index ff7b8c63d..c236b64ac 100644 --- a/src/utils/image.js +++ b/src/utils/image.js @@ -70,19 +70,23 @@ export const catchDraftImage = body => { return null; }; -export const getResizedImage = (url, size = 400) => { +export const getResizedImage = (url, size = 640) => { if (!url) { return ''; } - if (url.includes('img.esteem')) { + if (url.includes('img.esteem.ws')) { return `https://img.esteem.ws/${size}x0/${url}`; } + if (url.includes('img.esteem.app')) { + return `https://img.esteem.app/${size}x0/${url}`; + } + return `https://steemitimages.com/${size}x0/${url}`; }; -export const getResizedAvatar = (author, sizeString = 'small') => { +export const getResizedAvatar = (author, sizeString = 'medium') => { if (!author) { return ''; } diff --git a/src/utils/postParser.js b/src/utils/postParser.js index ae890f400..ba125be7b 100644 --- a/src/utils/postParser.js +++ b/src/utils/postParser.js @@ -91,7 +91,7 @@ const postImage = (metaData, body) => { } if (imageLink) { - return getResizedImage(imageLink, 600); + return getResizedImage(imageLink, 640); } return ''; };