Skip to content

Commit

Permalink
Merge pull request #1495 from TiagoCavalcanteTrindade/fix-images
Browse files Browse the repository at this point in the history
Decode encoded image source
  • Loading branch information
rocky authored Jul 22, 2021
2 parents 904f005 + 2e1e91c commit 1bbd518
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion mathics/builtin/drawing/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -1992,7 +1992,11 @@ def atom_to_boxes(self, f, evaluation):
encoded = base64.b64encode(contents)
encoded = b"data:image/png;base64," + encoded

return ImageBox(String(encoded), Integer(scaled_width), Integer(scaled_height))
return ImageBox(
String(encoded.decode("utf-8")),
Integer(scaled_width),
Integer(scaled_height),
)

def __str__(self):
return "-Image-"
Expand Down

0 comments on commit 1bbd518

Please sign in to comment.