Files
lua-scripts-w-api/contrib/darktable-api/bruno/modules/Patch Module.bru
stephen schuresko 0831ee943c feat(api): enhance image module management and export functionality
- Added read-write access to the darktable SQLite catalog for module parameter edits.
- Implemented new endpoints for exporting images and retrieving full-resolution images.
- Introduced PATCH method for updating module parameters with optional preview.
- Added comprehensive tests for new API functionalities, including module retrieval and error handling.
- Updated CORS headers to support new HTTP methods.
- Created detailed documentation for new API endpoints and module operations.
2026-06-10 19:50:56 -04:00

90 lines
2.4 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
meta {
name: Patch Module
type: http
seq: 3
}
patch {
url: {{baseUrl}}/api/v1/images/{{imageId}}/modules/filmicrgb
body: json
auth: bearer
}
auth:bearer {
token: {{accessToken}}
}
params:query {
~preview: medium
}
body:json {
{
"enabled": true,
"params": {
"grey_point_source": 18.45,
"white_point_source": 4.0,
"black_point_source": -8.0,
"contrast": 1.0
}
}
}
tests {
test("returns 204 (no preview) or 200 (with preview)", function() {
expect([200, 204]).to.include(res.status);
});
test("if 200, content-type is image/jpeg", function() {
if (res.status === 200) {
expect(res.headers["content-type"]).to.equal("image/jpeg");
}
});
}
docs {
## Patch Module
Update one or more parameters on a development module and optionally get a
preview image back showing the result.
### Body fields
- `enabled` (boolean, optional) – enable or disable the module
- `params` (object, optional) – named parameter overrides for known modules
- `params_b64` (string, optional) – raw base64 binary blob for unknown modules
(mutually exclusive with `params`)
Only fields present in `params` are changed; all others keep their current values.
### Preview query param
Add `?preview=small|medium|large|xlarge` to receive a JPEG thumbnail (200)
instead of empty 204. The server waits up to 30 s for the thumbnail to
regenerate before returning. Without this param the endpoint returns
**204 No Content** immediately (the bridge regenerates async in ~1-3 s).
### filmicrgb key parameters
| Field | Description | Default |
|---|---|---|
| `grey_point_source` | middle-grey exposure % | 18.45 |
| `black_point_source` | black relative exposure EV | -8.0 |
| `white_point_source` | white relative exposure EV | 4.0 |
| `contrast` | S-curve contrast | 1.0 |
| `saturation` | extreme-luminance saturation | 0.0 |
| `balance` | shadows ↔ highlights balance | 0.0 |
| `auto_hardness` | auto-adjust curve hardness | true |
### exposure key parameters
| Field | Description |
|---|---|
| `exposure` | exposure compensation in EV |
| `black` | black level correction |
| `mode` | 0=manual, 1=deflicker |
### temperature key parameters
| Field | Description |
|---|---|
| `red` | red channel multiplier |
| `green` | green channel multiplier |
| `blue` | blue channel multiplier |
}