Skip to content

Commit f32408d

Browse files
authored
Merge pull request #176 from AWDGroup/patch-1
Fixed the compile error
2 parents d026193 + bae7409 commit f32408d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

android/src/main/java/fr/greweb/reactnativeviewshot/ViewShot.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,11 @@ public void execute(NativeViewHierarchyManager nativeViewHierarchyManager) {
104104
final byte[] bytes = os.toByteArray();
105105
String data = Base64.encodeToString(bytes, Base64.NO_WRAP);
106106
// correct the extension if JPG
107+
String imageFormat = extension;
107108
if ("jpg".equals(extension)) {
108-
extension = "jpeg";
109+
imageFormat = "jpeg";
109110
}
110-
data = "data:image/"+extension+";base64," + data;
111+
data = "data:image/"+imageFormat+";base64," + data;
111112
promise.resolve(data);
112113
}
113114
} catch (Exception e) {

0 commit comments

Comments
 (0)