Update documents transformations + crisp.

This commit is contained in:
Patrick Fic
2021-06-10 14:16:02 -07:00
parent a4b58b4bd9
commit 75606559c6
4 changed files with 21 additions and 43905 deletions

View File

@@ -9,9 +9,18 @@ export const GenerateSrcUrl = (value) => {
)}/upload/${value.key}${extension ? `.${extension}` : ""}`;
};
export const GenerateThumbUrl = (value) =>
`${process.env.REACT_APP_CLOUDINARY_ENDPOINT}/${DetermineFileType(
export const GenerateThumbUrl = (value) => {
let extension = value.extension;
if (extension && extension.toLowerCase().includes("heic")) extension = "jpg";
else if (
DetermineFileType(value.type) !== "image" ||
(value.type && value.type.includes("application"))
)
extension = "jpg";
return `${process.env.REACT_APP_CLOUDINARY_ENDPOINT}/${DetermineFileType(
value.type
)}/upload/${process.env.REACT_APP_CLOUDINARY_THUMB_TRANSFORMATIONS}/${
value.key
}`;
}${extension ? `.${extension}` : ""}`;
};