Skip to content

Commit

Permalink
Merge pull request #767 from WPMedia/THEMES-1479
Browse files Browse the repository at this point in the history
THEMES-1479:
  • Loading branch information
vgalatro authored Oct 31, 2023
2 parents d8957c7 + d4bef93 commit 6d98582
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/components/MetaData/index.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const globalContentComplete = {
},
promo_items: {
basic: {
url: "awesome-url",
url: "https://awesome-url/image.jpg",
alt_text: "alt text",
},
},
Expand Down Expand Up @@ -73,7 +73,7 @@ const globalContentLeadArt = {
promo_items: {
lead_art: {
type: "image",
url: "awesome-url",
url: "https://awesome-url/image.jpg",
},
},
};
Expand All @@ -85,7 +85,7 @@ const globalContentLeadArtWithResize = {
0x0: "I0HK-BD7QKeAN9drBwVrYoryXDE=filters:format(jpg):quality(70):focal(3699x534:3709x544)/",
},
type: "image",
url: "awesome-url",
url: "https://awesome-url/image.jpg",
},
},
};
Expand Down
7 changes: 3 additions & 4 deletions src/components/MetaData/promoImageHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@ export const getImgURL = (metaValue, metaType = "og:image", globalContent, resiz
// eslint-disable-next-line @typescript-eslint/no-var-requires,global-require
const Thumbor = require("thumbor-lite");
const thumbor = new Thumbor(RESIZER_SECRET_KEY, resizerURL);
const imgSrc = _url
.replace(/^http[s]?:\/\//, "")
.replace(" ", "%20")
.replace("?", "%3F");
const imgSrc = new URL(_url)
.toString()
.replace(/^http[s]?:\/\//, "");
/*
We need the focal point out of the resize options to use as a filter
for the thumbor image being used here
Expand Down

0 comments on commit 6d98582

Please sign in to comment.