Animated GIF become JPEG
See original GitHub issueHi,
When I want to use an animated GIF with the picker, the image I receive is a JPEG. Do you know how to tell the picker this image is a GIF and aplly to it a GIF data64?
I’m on Android, my piece of code:
selectPhotoTapped() {
const options = {
quality: 1.0,
maxWidth: 800,
maxHeight: 800,
title: 'Select a picture',
cancelButtonTitle: 'Cancel',
title: 'Select a picture',
cancelButtonTitle: 'Cancel',
takePhotoButtonTitle: 'Take picture',
chooseFromLibraryButtonTitle: 'Phone'
//noData: false, // we use response.data to display gif
//allowsEditing: false // make sure we don't edit the gif
};
ImagePicker.showImagePicker(options, (response) => {
if (response.didCancel) { }
else if (response.error) { alert('ImagePicker Error: ', response.error); }
else if (response.customButton) { alert('User tapped custom button: ', response.customButton); }
else {
var source;
source = {uri: 'data:image/jpeg;base64,' + response.data, isStatic: true};
//Or:
//if (Platform.OS === 'android') { source = {uri: response.uri, isStatic: true}; }
//else { source = {uri: response.uri.replace('file://', ''), isStatic: true}; }
//this.setState({ avatarSource: source });
this.setState({ photo: source });
this.setState({ photoUpload: source.uri });
}
});
}
Thank you for your help!
Issue Analytics
- State:
- Created 7 years ago
- Comments:15 (6 by maintainers)
Top Results From Across the Web
GIF to JPG (Online & Free) - Convertio
Best way to convert your GIF to JPG file in seconds. 100% free, secure and easy to use! Convertio — advanced online tool...
Read more >GIF to JPG converter (online) - Ezgif
Upload a GIF and this tool will output high quality JPG image(s). It can also convert animated GIFs, in this case a sequence...
Read more >How to Save a GIF File As a JPEG - Techwalla
Navigate to the directory and file folder in which you wish to save your image. Type the name of the new JPEG file...
Read more >GIF to JPG - online-convert.com
Convert GIF to JPG in high quality by using this online file converter. ... Try the JPG conversion with a GIF test file....
Read more >GIF to JPEG Converter - Online Image Tools
These options will be used automatically if you select this example. Frame For animated GIFs, you can extract a specific frame here. Play...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@yfuks in my case I am resizing the image deliberately, I just want a way that when the gallery of my photo opens, we filter out
gif
… so my gallery would only showimage/jpeg
orimage/png
ONLY. so that the user does not get a chance to selectgif
My bad, I sent full header to Imagick, not just the data64. Thanks for your time!