-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
# Summary This PR removes the flag to include custom line breaks on `toDataUrl` method. Some software could not read base64 with additional line break characters, so it could lead to corrupting the image (like in react-native-share). Fixes #1986. ## Test Plan `TestsExample` -> `Test1986` ## Compatibility | OS | Implemented | | ------- | :---------: | | iOS | ✅ | | Android | ✅ |
- Loading branch information
Showing
4 changed files
with
34 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import React, {useRef, useState} from 'react'; | ||
import {Button, Image, View} from 'react-native'; | ||
import {Circle, Svg} from 'react-native-svg'; | ||
|
||
export default () => { | ||
const ref = useRef<Svg>(null); | ||
const [s, setS] = useState(''); | ||
return ( | ||
<View style={{flex: 1, paddingTop: 100}}> | ||
<Button | ||
onPress={() => { | ||
ref.current?.toDataURL(source => { | ||
setS(source); | ||
console.log(source); | ||
}); | ||
}} | ||
title="log data url" | ||
/> | ||
<Image | ||
width={400} | ||
height={300} | ||
source={{uri: `data:image/png;base64,${s}`}} | ||
/> | ||
<Svg width={400} height={300} ref={ref}> | ||
<Circle cx={200} cy={150} r={100} fill="red" /> | ||
</Svg> | ||
</View> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters