Skip to content

Commit

Permalink
Fix base64 images in notifications (#3775)
Browse files Browse the repository at this point in the history
Closes #3771

Signed-off-by: mueller-ma <mueller-ma@users.noreply.github.com>
  • Loading branch information
mueller-ma authored Jul 21, 2024
1 parent dc919bf commit 62a8469
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ sealed class CloudMessage : Parcelable {
if (itemStateFromMedia != null && itemStateFromMedia.toHttpUrlOrNull() == null) {
// media attachment is an item, but item state is not a URL -> interpret as base64 encoded image
return try {
val data = Base64.decode(itemStateFromMedia, Base64.DEFAULT)
val dataString = itemStateFromMedia.substring(itemStateFromMedia.indexOf(",") + 1)
val data = Base64.decode(dataString, Base64.DEFAULT)
BitmapFactory.decodeByteArray(data, 0, data.size)
} catch (e: IllegalArgumentException) {
null
Expand Down

0 comments on commit 62a8469

Please sign in to comment.