Revision Date Author Comments
# 8bda3995 06-Mar-2023 Desislav <[email protected]>

[expo-media-library] Allow saving animated gifs (#21549)

# Why

When saving animated GIFs on iOS with expo-media-library, the resulting images in the photo library are static. This PR fixes this i

[expo-media-library] Allow saving animated gifs (#21549)

# Why

When saving animated GIFs on iOS with expo-media-library, the resulting images in the photo library are static. This PR fixes this issue

# How
Use `PHAssetChangeRequest` instead of `UIImage.imageWithData`

# Test Plan

```typescript
import { StatusBar } from 'expo-status-bar';
import { Button, View, Image } from 'react-native';
import * as MediaLibrary from 'expo-media-library';
const gif = "https://upload.wikimedia.org/wikipedia/commons/2/2c/Rotating_earth_%28large%29.gif";
export default function App() {
const handleSave = () => {
MediaLibrary.saveToLibraryAsync(gif).then(() => alert("Saved")).catch(console.error);
}
return (
<View style={{ flex: 1, alignItems: "center", justifyContent: 'center' }}>
<StatusBar style="auto" />
<Image source={{ uri: gif }} style={{ width: 256, height: 256 }} />
<Button onPress={handleSave} title="Save" />
</View>
);
}
```

show more ...


# 54db654d 27-Sep-2019 Łukasz Kosmaty <[email protected]>

[media-library] Add saveToAssetsAsync method which doesn't need camera roll permissions (#5678)

# Why

Resolve #5089.

# How

Adding a new method, which needs `write only` access to users's ga

[media-library] Add saveToAssetsAsync method which doesn't need camera roll permissions (#5678)

# Why

Resolve #5089.

# How

Adding a new method, which needs `write only` access to users's gallery.

# Test Plan

- https://snack.expo.io/@lukaszkosmaty/80162f

show more ...