Skip to content

feat: DNG remote capture, with the JPEG of the same exposure - #5

Merged
juancobo merged 1 commit into
mainfrom
feat/dng-capture
Nov 13, 2026
Merged

juancobo merged 1 commit into
mainfrom
feat/dng-capture

Conversation

@juancobo

Copy link
Copy Markdown
Member

shoot(stream=True, dng=True) raised NotImplementedError, because CHDK
sends a DNG as two transfers, the header and the raw data, and the
library fetched one format. It now asks for both, fetches each as the
camera offers it, and returns a complete DNG. With jpeg=True it asks
for the JPEG too and returns a DngCapture with .dng and .jpeg, both
from one exposure and one script.

assemble_dng builds the file from the two parts: it reads the strip
offsets and sizes from the header, swaps the byte pairs of the raw
data, makes the thumbnail the header describes from the raw data, and
refuses a header it cannot read or raw data of another length. It uses
the standard library only.

The streamed JPEG path sends what it sent before.

Run on two Canon PowerShot A2500s under CHDK 1.5.1, one capture each:
4.2 s and 4.1 s for the DNG and the JPEG together, and both DNGs open
in macOS. Repeated captures and other viewers are not yet tested.

shoot(stream=True, dng=True) raised NotImplementedError, because CHDK
sends a DNG as two transfers, the header and the raw data, and the
library fetched one format. It now asks for both, fetches each as the
camera offers it, and returns a complete DNG. With jpeg=True it asks
for the JPEG too and returns a DngCapture with .dng and .jpeg, both
from one exposure and one script.

assemble_dng builds the file from the two parts: it reads the strip
offsets and sizes from the header, swaps the byte pairs of the raw
data, makes the thumbnail the header describes from the raw data, and
refuses a header it cannot read or raw data of another length. It uses
the standard library only.

The streamed JPEG path sends what it sent before.

Run on two Canon PowerShot A2500s under CHDK 1.5.1, one capture each:
4.2 s and 4.1 s for the DNG and the JPEG together, and both DNGs open
in macOS. Repeated captures and other viewers are not yet tested.
@juancobo
juancobo merged commit 330bec2 into main Nov 13, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant