Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
asset: assetLibraryImage,
example: `const { edges } = await CameraRoll.getPhotos({ first: 1 });
const asset = edges.map(({ node: { image } }) => image.uri)[0];
AssetUtils.resolveAsync(asset);`,
},
};
let parsed = {};
const keys = Object.keys(assets);
for (const key of keys) {
const { asset: res, ...props } = assets[key];
const asset = await AssetUtils.resolveAsync(res);
parsed[key] = { asset, ...props };
}
const base64 = await AssetUtils.base64forImageUriAsync(remoteImageUri);
const pngPrefix = 'data:image/png;base64,';
parsed['base64'] = {
title: 'Base64 Encoded',
description:
'From "ImageStore" this is a large string with a prefix of "data:image/png;base64,"',
asset: { uri: pngPrefix + base64.data },
example: `const { data } = await AssetUtils.base64forImageUriAsync(remoteImageUri);
const base64 = '${pngPrefix}' + data;`,
};
this.setState({ images: parsed });
}