Skip to content

Commit

Permalink
renaming file as jpg
Browse files Browse the repository at this point in the history
  • Loading branch information
rolandosborne committed Jun 9, 2024
1 parent 3e4233b commit b2d8332
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export function useImageAsset(asset) {
updateState({ downloaded: true });
const epoch = Math.ceil(Date.now() / 1000);
const dir = Platform.OS === 'ios' ? RNFS.DocumentDirectoryPath : RNFS.DownloadDirectoryPath;
const path = `${dir}/databag_${epoch}.dat`
const path = `${dir}/databag_${epoch}`
if (state.url.substring(0, 7) === 'file://') {
await RNFS.copyFile(state.url.substring(7).split('?')[0], path);
}
Expand All @@ -88,7 +88,8 @@ export function useImageAsset(asset) {
}
const block = await RNFS.read(path, 8, 0, 'base64');
if (block === '/9j/4AAQSkY=') {
await RNFS.scanFile(path);
await RNFS.moveFile(path, `${path}.jpg}`);
await RNFS.scanFile(`${path}.jpg}`);
}
}
},
Expand Down

0 comments on commit b2d8332

Please sign in to comment.