mirror of
https://github.com/ecency/ecency-mobile.git
synced 2024-12-22 04:41:43 +03:00
Merge pull request #1340 from esteemapp/image-resize
increase image sizes for better quality
This commit is contained in:
commit
758dc0aa19
src
components
profileEditForm
profileSummary/view
userAvatar/view
utils
@ -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}
|
||||
/>
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
? {
|
||||
|
@ -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 '';
|
||||
}
|
||||
|
@ -91,7 +91,7 @@ const postImage = (metaData, body) => {
|
||||
}
|
||||
|
||||
if (imageLink) {
|
||||
return getResizedImage(imageLink, 600);
|
||||
return getResizedImage(imageLink, 640);
|
||||
}
|
||||
return '';
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user