Commit 623f576b authored by matthmey's avatar matthmey

Merge remote-tracking branch 'shadow/develop'

parents fbdbe7a4 ce47f731
......@@ -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,10 +196,9 @@ 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())
assert data[0].values == img_base64
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
start_time = dt.datetime(2017, 8, 6, 9, 55, 12, tzinfo=dt.timezone.utc)
......
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