Skip to content

Commit

Permalink
[android] update base64 decoding options (expo#7841)
Browse files Browse the repository at this point in the history
* [android] [camera] use .NO_WRAP to encode base64 output

* [android] [image-manipulator] use .NO_WRAP to encode base64 output

* [android] [image-picker] use .NO_WRAP to encode base64 output

* [android] [print] use .NO_WRAP to encode base64 output

* [android] [secure-store] use .NO_WRAP to encode base64 output

Co-authored-by: Bartłomiej Bukowski <bartlomiejbukowski.b@gmail.com>
Co-authored-by: Łukasz Kosmaty <lukasz.kosmaty@student.uj.edu.pl>
  • Loading branch information
3 people committed Apr 16, 2020
1 parent 5f68230 commit dced656
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Expand Up @@ -4,6 +4,8 @@

### 🛠 Breaking changes

- The base64 output will no longer contain newline and special character (`\n`, `\r`) on Android. ([#7841](https://github.com/expo/expo/pull/7841) by [@jarvisluong](https://github.com/jarvisluong))

### 🎉 New features

### 🐛 Bug fixes
Expand Up @@ -135,7 +135,7 @@ protected Bundle doInBackground(Void... voids) {

// Write base64-encoded image to the response if requested
if (isOptionEnabled(BASE64_KEY)) {
response.putString(BASE64_KEY, Base64.encodeToString(imageStream.toByteArray(), Base64.DEFAULT));
response.putString(BASE64_KEY, Base64.encodeToString(imageStream.toByteArray(), Base64.NO_WRAP));
}

// Cleanup
Expand Down Expand Up @@ -197,7 +197,7 @@ private Bundle handleSkipProcessing() {

// handle base64
if (isOptionEnabled(BASE64_KEY)) {
response.putString(BASE64_KEY, Base64.encodeToString(mImageData, Base64.DEFAULT));
response.putString(BASE64_KEY, Base64.encodeToString(mImageData, Base64.NO_WRAP));
}

return response;
Expand Down

0 comments on commit dced656

Please sign in to comment.