schoolpost / PiDNG

Create Adobe DNG RAW files using Python. Works with any Bayer RAW Data including native support for Raspberry Pi cameras.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

UnicodeDecodeError with version 3.1.1

PRRPCHT opened this issue · comments

Hi,

I've just replaced PyDNG 3.0.1 with 3.1.1 and I get this error:

Exception in thread Thread-9:
Traceback (most recent call last):
  File "/usr/lib/python3.7/threading.py", line 917, in _bootstrap_inner
    self.run()
  File "/home/pi/Dev/Lapse/dngconverter.py", line 17, in run
    output = d.convert(self.frompath + self.filename + ".jpg", process=True)
  File "/home/pi/Dev/Lapse/venv/lib/python3.7/site-packages/pydng/core.py", line 240, in convert
    rawFrame = self.__process__(image, process)
  File "/home/pi/Dev/Lapse/venv/lib/python3.7/site-packages/pydng/core.py", line 213, in __process__
    rawImage = self.__extractRAW__(input_file)
  File "/home/pi/Dev/Lapse/venv/lib/python3.7/site-packages/pydng/core.py", line 157, in __extractRAW__
    maker_note = img.getvalue()[0x246:0x39c].decode()
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xba in position 331: invalid start byte

When reverting to 3.0.1 it works again. Image taken with Picamera:
camera.capture(id + ".jpg", format = "jpeg", bayer = True)

Hard coded the offsets for detecting maker note in the file. Now fixed. Will be out in the next verison. 3.1.2