Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
PhotoType.Thumbnail,
metadata.type
);
await StorageService.setItem(mainId + '-thumbnail', thumbnailData);
rawPhoto = thumbnailData;
} else {
photoType = PhotoType.Download;
}
} else if (!rawPhoto && photoType === PhotoType.Viewer) {
rawPhoto = await StorageService.getItem(mainId, false);
const { Device } = Plugins;
const info = await Device.getInfo();
if (info.model !== 'iPhone' && info.model !== 'iPad') {
const viewerData = await PhotosService.compressPhoto(
await imageCompression.getFilefromDataUrl(rawPhoto),
PhotoType.Viewer,
metadata.type
);
await StorageService.setItem(mainId + '-viewer', viewerData, true);
rawPhoto = viewerData;
} else {
photoType = PhotoType.Download;
}
}
if (!rawPhoto) {
return false;
}
if (rawPhoto && !rawPhoto.match('data:image/.*')) {
metadata.type