mirror of
https://github.com/ecency/ecency-mobile.git
synced 2024-12-31 17:54:52 +03:00
resizing issue fix
This commit is contained in:
parent
1b2219a651
commit
1d80940bf4
@ -76,11 +76,11 @@ export const getResizedImage = (url, size = 640) => {
|
||||
}
|
||||
|
||||
if (url.includes('img.esteem.ws')) {
|
||||
return `https://img.esteem.ws/${size}x0/${url}`;
|
||||
return `${url.replace('img.esteem.ws/', `img.esteem.ws/${size}/`)}`;
|
||||
}
|
||||
|
||||
if (url.includes('img.esteem.app')) {
|
||||
return `https://img.esteem.app/${size}x0/${url}`;
|
||||
return `${url.replace('img.esteem.app/', `img.esteem.app/${size}/`)}`;
|
||||
}
|
||||
|
||||
return `https://steemitimages.com/${size}x0/${url}`;
|
||||
|
@ -70,10 +70,9 @@ const postImage = (metaData, body) => {
|
||||
const urlRegex = /(http|ftp|https):\/\/([\w_-]+(?:(?:\.[\w_-]+)+))([\w.,@?^=%&:/~+#-]*[\w@?^=%&/~+#-])?/gm;
|
||||
const imageRegex = /(http(s?):)([/|.|\w|\s|-])*\.(?:jpg|gif|png)/g;
|
||||
let imageLink;
|
||||
|
||||
if (metaData && metaData.image && metaData.image[0]) {
|
||||
[imageLink] = metaData.image;
|
||||
} else if (body && markdownImageRegex.test(body)) {
|
||||
} else if (!imageLink && body && markdownImageRegex.test(body)) {
|
||||
const markdownMatch = body.match(markdownImageRegex);
|
||||
if (markdownMatch[0]) {
|
||||
const firstMarkdownMatch = markdownMatch[0];
|
||||
|
Loading…
Reference in New Issue
Block a user