Merge pull request from esteemapp/image-resize

increase image sizes for better quality
This commit is contained in:
Feruz M 2019-12-01 13:05:46 +02:00 committed by GitHub
commit 758dc0aa19
5 changed files with 11 additions and 7 deletions
src
components
profileEditForm
profileSummary/view
userAvatar/view
utils

View File

@ -47,7 +47,7 @@ const ProfileEditFormView = ({
<TouchableOpacity style={styles.coverImgWrapper} onPress={showImageUploadActions}>
<Image
style={styles.coverImg}
source={{ uri: getResizedImage(coverUrl, 400) }}
source={{ uri: getResizedImage(coverUrl, 640) }}
defaultSource={isDarkTheme ? DARK_COVER_IMAGE : LIGHT_COVER_IMAGE}
/>

View File

@ -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

View File

@ -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
? {

View File

@ -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 '';
}

View File

@ -91,7 +91,7 @@ const postImage = (metaData, body) => {
}
if (imageLink) {
return getResizedImage(imageLink, 600);
return getResizedImage(imageLink, 640);
}
return '';
};