detecttechnologies / thermal_base

Decoding and common processing for thermographs / thermograms. Currently supports FLIR's TIFF and PNG encoded metadata, and DJI-encoded metadata
MIT License
54 stars 9 forks source link

Getting "JSONDecodeError: Expecting value" error #10

Closed luc-girod closed 2 years ago

luc-girod commented 2 years ago

Hello!

I just updated my installation of thermal_base since it now support M2EA (thanks!!!), but I now get an error while reading a file (either one H20T file that worked well previously, or a Mavic 2EA file:

Code:

from thermal_base import ThermalImage
image = ThermalImage(image_path="./DJI_20220113111141_0001_T.JPG", camera_manufacturer="dji")

Error:

Traceback (most recent call last):

  File "<ipython-input-3-388d8aa846c9>", line 1, in <module>
    image = ThermalImage(image_path="./DJI_20220113111141_0001_T.JPG", camera_manufacturer="dji")

  File "C:\ProgramData\Anaconda3\lib\site-packages\thermal_base\thermal_base.py", line 44, in __init__
    self.thermal_np, self.raw_sensor_np, self.meta = self.extract_temperatures_dji()

  File "C:\ProgramData\Anaconda3\lib\site-packages\thermal_base\thermal_base.py", line 120, in extract_temperatures_dji
    meta = json.loads(meta_json)[0]

  File "C:\ProgramData\Anaconda3\lib\json\__init__.py", line 348, in loads
    return _default_decoder.decode(s)

  File "C:\ProgramData\Anaconda3\lib\json\decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())

  File "C:\ProgramData\Anaconda3\lib\json\decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None

JSONDecodeError: Expecting value
luc-girod commented 2 years ago

Alright, I think I just didn't have exiftool in my path when I started Anaconda and adding it afterwards without restarting didn't translate...

Fixed.