To receive notifications about scheduled maintenance, please subscribe to the mailing-list gitlab-operations@sympa.ethz.ch. You can subscribe to the mailing-list at https://sympa.ethz.ch

Commit a1de9d59 authored by matthmey's avatar matthmey
Browse files

fixed base64 image loading

parent 757a5e4d
......@@ -1058,9 +1058,7 @@ class MHDSLRImages(MHDSLRFilenames):
times = []
for timestamp, element in filenames.iterrows():
key = element.filename
img = Image.open(io.BytesIO(self.config["store"][key]))
img = np.array(img.convert("RGB"))
img_base64 = base64.b64encode(img.tobytes())
img_base64 = base64.b64encode(self.config["store"][key])
images.append(img_base64)
times.append(timestamp)
......
......@@ -196,9 +196,8 @@ def test_mhdslrimage():
from PIL import Image
img = Image.open(base_dir.joinpath("2017-08-06", "20170806_095212.JPG"))
img_base64 = base64.b64encode(img.tobytes())
with open(base_dir.joinpath("2017-08-06", "20170806_095212.JPG"), "rb") as image_file:
img_base64 = base64.b64encode(image_file.read())
assert data[0].values == img_base64
# Check a period where there is no image
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment