MCPcopy Create free account
hub / github.com/apitable/apitable / showOriginImageThumbnail

Function showOriginImageThumbnail

packages/datasheet/src/pc/utils/file_type.ts:190–193  ·  view source on GitHub ↗
(file: IAttachmentValue)

Source from the content-addressed store, hash-verified

188 * Whether to display thumbnails of the original image, e.g. not after the volume exceeds 20Mb
189 */
190export const showOriginImageThumbnail = (file: IAttachmentValue) => {
191 const fileArgument = { name: file.name, type: file.mimeType };
192 return (isPdf(fileArgument) && file.preview) || (isImage(fileArgument) && !imageSizeExceeded(file.size) && isSupportImage(file.mimeType));
193};
194
195export const isSupportImage = (mimeType: string) => {
196 return !NO_SUPPORT_IMG_MIME_TYPE.includes(mimeType);

Callers 4

calcFileWidthFunction · 0.90
DisplayFileBaseFunction · 0.90
calcFileWidthFunction · 0.90
getCellValueThumbSrcFunction · 0.70

Calls 4

isPdfFunction · 0.90
isImageFunction · 0.90
imageSizeExceededFunction · 0.70
isSupportImageFunction · 0.70

Tested by

no test coverage detected