RPICAM2DNG() not converting mode 2 High Quality Cam
dgcarr opened this issue · comments
Get the following error when trying to extract raw DNG from photos taken in mode 2 on rpi high quality camera
(raspistill --mode 2 -r -o test.jpg):
Traceback (most recent call last):
d.convert(im)
File "C:\Users\daggy\AppData\Roaming\Python\Python39\site-packages\pidng\core.py", line 267, in convert
rawFrame = self.process(image, process)
File "C:\Users\daggy\AppData\Roaming\Python\Python39\site-packages\pidng\core.py", line 232, in process
rawImage = self.extractRAW(input_file)
File "C:\Users\daggy\AppData\Roaming\Python\Python39\site-packages\pidng\core.py", line 195, in extractRAW
assert data[:4] == 'BRCM'.encode("ascii")
AssertionError
Can you send a link to this RAW image?
The reason for this error because even though you are using mode 2 RAW, the jpeg file is still creating a 4056x3040 sized image and therefore PiDNG assumes it is full size RAW. ( which is the correct assumption based the jpeg )
So two ways around this:
- Make the JPEG output the same dimensions as the RAW output ( so 2028x1520 )
- Edit the EXIF data of the jpeg and change the ImageWidth and ImageLength to 2028x1520
- Edit the PiDNG source and set the version variable to version 4.
Lines 178 to 183 in 30bee22
So you could add a line and just set "ver = 4"