resizing issue fix

This commit is contained in:
feruz 2019-12-16 07:42:11 +02:00
parent 1b2219a651
commit 1d80940bf4
2 changed files with 3 additions and 4 deletions

View File

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

View File

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