Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions examples/demo/advanced/javascript_hover_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"""
# Standard library imports
import os, sys, webbrowser, io
from base64 import encodestring
from base64 import encodebytes

# Major library imports
from PIL import Image
Expand Down Expand Up @@ -537,12 +537,12 @@ def make_palettized_png_str(gc):
if format != "RGBA":
gc = gc.convert_pixel_format("rgba32")
img = Image.frombytes(
"RGBA", (gc.width(), gc.height()), gc.bmp_array.tostring()
"RGBA", (gc.width(), gc.height()), gc.bmp_array.tobytes()
)
img2 = img.convert("P")
output_buf = io.BytesIO()
img2.save(output_buf, "png")
output = encodestring(output_buf.getvalue())
output = encodebytes(output_buf.getvalue())
output_buf.close()
return output

Expand Down