Repository URL to install this package:
|
Version:
3.12.2 ▾
|
import { BYTES_TO_MEGA_BYTES, LARGE_FILE_SIZE_IN_MB } from './constants';
import isAi from './isAi';
import isJpg from './isJpg';
import isPhotoshopFile from './isPhotoshopFile';
import isTiff from './isTiff';
export default function isCloudimageFastPreviewSupported(file) {
if (!file) return false;
var _ref = (file === null || file === void 0 ? void 0 : file.size) || {},
_ref$bytes = _ref.bytes,
bytes = _ref$bytes === void 0 ? 1 : _ref$bytes;
var isLargeJpgFile = bytes / BYTES_TO_MEGA_BYTES > LARGE_FILE_SIZE_IN_MB && isJpg(file);
if (isPhotoshopFile(file) || isTiff(file) || isAi(file) || isLargeJpgFile) {
return true;
}
return false;
}