mirror of
https://github.com/ecency/ecency-mobile.git
synced 2024-12-22 12:51:42 +03:00
Merge pull request #1340 from esteemapp/image-resize
increase image sizes for better quality
This commit is contained in:
commit
758dc0aa19
@ -47,7 +47,7 @@ const ProfileEditFormView = ({
|
|||||||
<TouchableOpacity style={styles.coverImgWrapper} onPress={showImageUploadActions}>
|
<TouchableOpacity style={styles.coverImgWrapper} onPress={showImageUploadActions}>
|
||||||
<Image
|
<Image
|
||||||
style={styles.coverImg}
|
style={styles.coverImg}
|
||||||
source={{ uri: getResizedImage(coverUrl, 400) }}
|
source={{ uri: getResizedImage(coverUrl, 640) }}
|
||||||
defaultSource={isDarkTheme ? DARK_COVER_IMAGE : LIGHT_COVER_IMAGE}
|
defaultSource={isDarkTheme ? DARK_COVER_IMAGE : LIGHT_COVER_IMAGE}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
@ -105,7 +105,7 @@ class ProfileSummaryView extends PureComponent {
|
|||||||
const isColumn = rowLength && DEVICE_WIDTH / rowLength <= 7.3;
|
const isColumn = rowLength && DEVICE_WIDTH / rowLength <= 7.3;
|
||||||
|
|
||||||
const followButtonIcon = !isFollowing ? 'account-plus' : 'account-minus';
|
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) {
|
if (!coverImageUrl) {
|
||||||
coverImageUrl = isDarkTheme
|
coverImageUrl = isDarkTheme
|
||||||
|
@ -54,7 +54,7 @@ class UserAvatarView extends Component {
|
|||||||
avatarUrl,
|
avatarUrl,
|
||||||
currentUsername: { name, avatar },
|
currentUsername: { name, avatar },
|
||||||
} = this.props;
|
} = this.props;
|
||||||
const imageSize = size === 'xl' ? 'large' : 'small';
|
const imageSize = size === 'xl' ? 'large' : 'medium';
|
||||||
let _size;
|
let _size;
|
||||||
const _avatar = username
|
const _avatar = username
|
||||||
? {
|
? {
|
||||||
|
@ -70,19 +70,23 @@ export const catchDraftImage = body => {
|
|||||||
return null;
|
return null;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const getResizedImage = (url, size = 400) => {
|
export const getResizedImage = (url, size = 640) => {
|
||||||
if (!url) {
|
if (!url) {
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (url.includes('img.esteem')) {
|
if (url.includes('img.esteem.ws')) {
|
||||||
return `https://img.esteem.ws/${size}x0/${url}`;
|
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}`;
|
return `https://steemitimages.com/${size}x0/${url}`;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const getResizedAvatar = (author, sizeString = 'small') => {
|
export const getResizedAvatar = (author, sizeString = 'medium') => {
|
||||||
if (!author) {
|
if (!author) {
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
@ -91,7 +91,7 @@ const postImage = (metaData, body) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (imageLink) {
|
if (imageLink) {
|
||||||
return getResizedImage(imageLink, 600);
|
return getResizedImage(imageLink, 640);
|
||||||
}
|
}
|
||||||
return '';
|
return '';
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user