fix: file size

This commit is contained in:
Paribesh01
2025-02-07 02:04:24 +05:30
parent a526bb08be
commit 1acf334ad3
@@ -117,6 +117,11 @@ export const getAllowedFiles = async (
try {
const convertedFile = await convertHeicToJpeg(file);
if (convertedFile) {
const convertedFileSizeInMB = convertedFile.size / 1000000;
if (maxSizeInMB && convertedFileSizeInMB > maxSizeInMB) {
sizeExceedFiles.push(file.name);
continue;
}
convertedFiles.push(
new File([convertedFile], file.name.replace(/\.heic$/i, ".jpg"), {
type: "image/jpeg",