Skip to content

Commit

Permalink
[F] Callouts use new DAM plugin
Browse files Browse the repository at this point in the history
Includes:
 - Main Callout Image
 - TwoTone Callout Background Image
 - Glossary Term Image
 - Investigation Hero Images
  • Loading branch information
Blake Mason authored and jtrouth committed Mar 4, 2024
1 parent fc6b559 commit 5d13453
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 17 deletions.
3 changes: 0 additions & 3 deletions lib/api/fragments/image.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,4 @@ cantoAssetSingle {
CaptionES
Credit
}
fileInfo: metadata {
fileType: FileTypeExtension
}
}`;
17 changes: 3 additions & 14 deletions lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -418,13 +418,7 @@ export const imageShaper = (site, data, className) => {

const key = localeKeys[site];

const {
metadata,
url,
width,
height,
fileInfo: { fileType },
} = data;
const { metadata, url, width, height } = data;
const { directUrlPreview = "", directUrlOriginal = "", preview = "" } = url;

const urlWithoutConstraint = directUrlPreview.slice(0, -3);
Expand All @@ -433,15 +427,10 @@ export const imageShaper = (site, data, className) => {
const altText = metadata[`AltText${key}`];
const caption = metadata[`Caption${key}`];
const credit = metadata.Credit;
const useOriginal = fileType === "gif";

return {
url: useOriginal
? directUrlOriginal
: `${urlWithoutConstraint}${Math.floor(constraint / 3)}`,
url2x: useOriginal
? directUrlOriginal
: `${urlWithoutConstraint}${Math.floor(constraint / 2)}`,
url: `${urlWithoutConstraint}${Math.floor(constraint / 3)}`,
url2x: `${urlWithoutConstraint}${Math.floor(constraint / 2)}`,
url3x: directUrlOriginal,
thumb: preview,
width: Number(width),
Expand Down

0 comments on commit 5d13453

Please sign in to comment.