mirror of
https://github.com/zoriya/react-native-svg.git
synced 2026-06-04 15:44:24 +00:00
fix: toDataUrl line breaks (#2272)
# 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 | ✅ |
This commit is contained in:
@@ -339,7 +339,7 @@ public class SvgView extends ReactViewGroup implements ReactCompoundView, ReactC
|
||||
bitmap.compress(Bitmap.CompressFormat.PNG, 100, stream);
|
||||
bitmap.recycle();
|
||||
byte[] bitmapBytes = stream.toByteArray();
|
||||
return Base64.encodeToString(bitmapBytes, Base64.DEFAULT);
|
||||
return Base64.encodeToString(bitmapBytes, Base64.NO_WRAP);
|
||||
}
|
||||
|
||||
String toDataURL(int width, int height) {
|
||||
@@ -353,7 +353,7 @@ public class SvgView extends ReactViewGroup implements ReactCompoundView, ReactC
|
||||
bitmap.compress(Bitmap.CompressFormat.PNG, 100, stream);
|
||||
bitmap.recycle();
|
||||
byte[] bitmapBytes = stream.toByteArray();
|
||||
return Base64.encodeToString(bitmapBytes, Base64.DEFAULT);
|
||||
return Base64.encodeToString(bitmapBytes, Base64.NO_WRAP);
|
||||
}
|
||||
|
||||
void enableTouchEvents() {
|
||||
|
||||
Reference in New Issue
Block a user