Image saving - fix extension, increase download timeout (#9388)
This commit is contained in:
@@ -84,14 +84,14 @@ export async function shareImageModal({uri}: {uri: string}) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// we're currently relying on the fact our CDN only serves pngs
|
// we're currently relying on the fact our CDN only serves jpegs
|
||||||
// -prf
|
// -prf
|
||||||
const imageUri = await downloadImage(uri, createPath('png'), 5e3)
|
const imageUri = await downloadImage(uri, createPath('jpg'), 15e3)
|
||||||
const imagePath = await moveToPermanentPath(imageUri, '.png')
|
const imagePath = await moveToPermanentPath(imageUri, '.jpg')
|
||||||
safeDeleteAsync(imageUri)
|
safeDeleteAsync(imageUri)
|
||||||
await Sharing.shareAsync(imagePath, {
|
await Sharing.shareAsync(imagePath, {
|
||||||
mimeType: 'image/png',
|
mimeType: 'image/jpeg',
|
||||||
UTI: 'image/png',
|
UTI: 'image/jpeg',
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -100,11 +100,11 @@ const ALBUM_NAME = 'Bluesky'
|
|||||||
export async function saveImageToMediaLibrary({uri}: {uri: string}) {
|
export async function saveImageToMediaLibrary({uri}: {uri: string}) {
|
||||||
// download the file to cache
|
// download the file to cache
|
||||||
// NOTE
|
// NOTE
|
||||||
// assuming PNG
|
// assuming JPEG
|
||||||
// we're currently relying on the fact our CDN only serves pngs
|
// we're currently relying on the fact our CDN only serves jpegs
|
||||||
// -prf
|
// -prf
|
||||||
const imageUri = await downloadImage(uri, createPath('png'), 5e3)
|
const imageUri = await downloadImage(uri, createPath('jpg'), 15e3)
|
||||||
const imagePath = await moveToPermanentPath(imageUri, '.png')
|
const imagePath = await moveToPermanentPath(imageUri, '.jpg')
|
||||||
|
|
||||||
// save
|
// save
|
||||||
try {
|
try {
|
||||||
|
|||||||
Reference in New Issue
Block a user