Skip to content

Commit 5518b97

Browse files
committed
fix: add documentation about editing images in documents
1 parent 507228e commit 5518b97

File tree

12 files changed

+138
-29
lines changed

12 files changed

+138
-29
lines changed

content/customising/server-configuration/storage/_index.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ storage: {
4242
The default configuration will return `{dateString}/{randomString}{ext}`, but you can use the provided parameters on `computeKey()`
4343
to compose a key blueprint that matches your needs, e.g. separate media by projectId with `{projectId}/{dateString}/{randomString}{extension}`.
4444

45+
{{< warning >}}
46+
Keys starting with `v/` are reserved for [image editing in documents]({{< ref "/guides/media-library/2025-behavior/#image-editing-in-documents" >}}) and must not be returned by a custom `computeKey` function.
47+
{{< /warning >}}
48+
4549
## Strategies
4650

4751
#### Memory
66.4 KB
Loading
214 KB
Loading
2.1 MB
Loading

content/guides/media-library/2025-behavior/index.md

Lines changed: 57 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@ weight: 5
66

77
## Overview
88

9-
The Media Library is being upgraded during 2025, and the main improvements include:
10-
- Image editing (colour correction and redaction)
9+
The `use2025Behavior` represents the future direction of the Media Library. It unlocks new capabilities that were previously not possible. We recommend that new setups always enable it, and existing setups are encouraged to migrate.
10+
11+
- Image editing (colour corrections, rotation and pixelation)
1112
- Automated deletion routines
1213
- Manual media library entry deletion
1314
- Removal of the "Archive" functionality
@@ -35,7 +36,7 @@ Be aware that this also requires additional configuration steps such as modifyin
3536

3637
## Features
3738

38-
### Image variant Storage / Delivery
39+
### Image Variant Storage / Delivery
3940

4041
{{< added-in "release-2025-03" block >}}
4142

@@ -77,12 +78,38 @@ This endpoint delivers the image with its original dimensions, as long as it has
7778
To avoid performance bottlenecks ensure you place a CDN or image proxy in front of Livingdocs, retrieving images via the new API. This prevents excessive load on the Livingdocs Server.
7879

7980
Whenever an asset gets modified, we emit the [`mediaLibraryEntry.update`]({{< ref "/customising/advanced/server-events/#media-library-entry" >}}) server event. This event can be used to purge a CDN or other image service. The `mediaLibraryEntry.update` event also occurs for metadata changes, so if you want to only handle asset changes you can filter the events by checking whether `payload.changes?.some((c) => c.event === 'mediaLibraryEntry.asset.update')`.
81+
82+
When purging a CDN cache for a revoked, invalidated, or updated entry, use `mediaLibraryApi.getAllKeysForMediaLibraryEntry({mediaLibraryEntry})` to retrieve all asset keys associated with the entry, including variant keys from [image editing in documents](#image-editing-in-documents):
83+
84+
```js
85+
liServer.events.subscribe(
86+
'mediaLibraryEntry.update',
87+
async (event, {mediaLibraryEntry, changes}) => {
88+
const isAssetUpdate = changes?.some((c) => c.event === 'mediaLibraryEntry.asset.update')
89+
if (!isAssetUpdate) return
90+
const keys = await mediaLibraryApi.getAllKeysForMediaLibraryEntry({mediaLibraryEntry})
91+
// Purge all keys from your CDN
92+
}
93+
)
94+
95+
liServer.events.subscribe('mediaLibraryEntry.revoke', async (event, {mediaLibraryEntry}) => {
96+
const keys = await mediaLibraryApi.getAllKeysForMediaLibraryEntry({mediaLibraryEntry})
97+
// Purge all keys from your CDN
98+
})
99+
100+
liServer.events.subscribe('mediaLibraryEntry.invalid', async (event, {mediaLibraryEntry}) => {
101+
const keys = await mediaLibraryApi.getAllKeysForMediaLibraryEntry({mediaLibraryEntry})
102+
// Purge all keys from your CDN
103+
})
104+
```
105+
80106
{{< /info >}}
81107
82108
{{< warning >}}
83109
If you had a path (and not just a domain) in `serverConfig.mediaLibrary.images.publicUrl`, or if you have documents which were created before {{< release "release-2024-03" >}}, you will need to set `serverConfig.mediaLibrary.generateImageServiceUrlsOnRead: true`.
84110
85111
If both of the above conditions apply you will also need to define `serverConfig.mediaLibrary.images.storage.extractKey` as something like the following:
112+
86113
```js
87114
extractKey(url) {
88115
const path = new URL(url).pathname
@@ -92,21 +119,42 @@ extractKey(url) {
92119
: path
93120
}
94121
```
122+
95123
{{< /warning >}}
96124
97125
### Image Editing
98126
99127
{{< added-in "release-2025-05" block >}}
100128
101-
Journalists are sometimes required to redact areas of an image, such as license plates or faces, or to perform color corrections, such as adjusting brightness, contrast, or saturation. To simplify this task and eliminate the need for external tools, Livingdocs supports basic image editing.
129+
Livingdocs supports image editing to allow journalists to redact sensitive areas (such as license plates or faces) and apply colour corrections, without the need for external tools.
102130
103-
{{< img src="./image-editor-button.png" alt="Image Editor Button" >}}
131+
Image editing is supported for jpg, png, and webp formats. Images must be requested via the public API endpoint [`GET /api/2025-03/mediaLibrary/serve-image/:key`]({{< ref "/reference/public-api/media-library/#serve-image" >}}) for the modifications to be applied.
104132
105-
Users can open the image editor by clicking the edit button in the media center detail view. It allows users to adjust brightness, contrast, or saturation, as well as blur parts of an image. The original image is always preserved and can be restored at any time. Users can also continue editing an image or selectively undo specific adjustments at a later point.
133+
#### Image Editing in the Media Library
106134
107-
{{< img src="./image-editor.png" alt="Image Editor" >}}
135+
Users can open the image editor by clicking the edit button in the media library detail view. Edits here apply globally to all documents that reference the image. The original is always preserved and can be restored at any time.
108136
109-
Image editing is supported for jpg, png, and webp formats. Accordingly, images must be requested via the public API endpoint [`GET /api/2025-03/mediaLibrary/serve-image/{key}`]({{< ref "/reference/public-api/media-library/#serve-image" >}}) for the modifications to be applied. The edited image will be delivered in place of the original. The original version remains stored and can be restored in the editor.
137+
This supports:
138+
139+
- Redaction: pixelate areas of the image (e.g. faces, license plates)
140+
- Colour corrections: brightness, contrast, and saturation ({{< removed-in "release-2026-03" >}})
141+
142+
{{< img src="image-editing-pixelate.png" alt="Pixelate image" width="400" caption="Pixelation remains in the media library and applies globally to all placements of the image." >}}
143+
144+
#### Image Editing in Documents
145+
146+
{{< added-in "release-2026-03" block >}}
147+
148+
Journalists can edit images directly within a document using the "Adjust" button on each image placement. Edits here only affect that specific placement within the document. Other documents using the same image are not affected. The original can always be restored by resetting the adjustments.
149+
150+
This supports:
151+
152+
- Colour corrections: brightness, contrast, and saturation
153+
- Rotation
154+
155+
{{< img src="image-editing-adjust.png" alt="Adjust image" width="400" caption="The Adjust button lets users apply colour adjustments or fix a skewed horizon per placement." >}}
156+
157+
{{< img src="image-editing-rotate.png" alt="Rotate image" caption="Images can be rotated per placement directly within a document." >}}
110158
111159
### Archive/Revoke/Delete
112160
@@ -173,6 +221,7 @@ To configure a deletion routine you need to add the `deletionRoutine` config to
173221
The filters property uses our usual [Search Filters Query DSL]({{< ref "/reference/public-api/publications/search-filters" >}}) in the same way as a base filter. Any unused media library entry which matches will be deleted.
174222
175223
Livingdocs automatically handles the "unused" part which excludes media library entries that:
224+
176225
- are referenced by documents
177226
- are referenced by other media library entries
178227
- are currently in a document inbox
66.4 KB
Loading
214 KB
Loading
2.1 MB
Loading

content/operations/releases/release-2026-03.md

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ These are the release notes of the upcoming release (pull requests merged to the
6464
- :fire: Integration against the upcoming release (currently `main` branch) is at your own risk
6565

6666
## PRs to Categorize
67+
6768
- [Bump minor version for release management](https://github.com/livingdocsIO/livingdocs-editor/pull/10779)
6869
- [Bump minor version for release management](https://github.com/livingdocsIO/livingdocs-server/pull/8976)
6970
- [Add image collections](https://github.com/livingdocsIO/livingdocs-editor/pull/10700)
@@ -168,7 +169,16 @@ No pre-deployment steps are required before rolling out this release.
168169

169170
#### Migrate the Postgres Database
170171

171-
No migrations are required for this release.
172+
When upgrading, first run the database migrations. At Livingdocs, we run this command in an initContainer on Kubernetes.
173+
174+
All migrations should execute quickly and not lock write-heavy tables.
175+
176+
```sh
177+
# 216-image-variants.js
178+
# Creates the `media_library_entries_image_variants` table for image editing
179+
# in documents.
180+
livingdocs-server migrate up
181+
```
172182

173183
### After the deployment
174184

@@ -198,10 +208,42 @@ Or preferably to our recommended versions:
198208

199209
The media source plugin function `searchMediaImage` now requires `systemName` and `externalId` to be strings when returned. Previously, these properties were not validated and had no effect.
200210

211+
### Reserved `v/` Key Prefix for Image Editing in Documents :fire:
212+
213+
Image variant keys use the `v/` prefix (e.g. `v/2026/02/10/abc123`). If you have configured a custom [`storage.computeKey`]({{< ref "/customising/server-configuration/storage/#interface" >}}) function for image storage, ensure it does not return keys starting with `v/`.
214+
201215
## Deprecations
202216

217+
### `mediaLibrary.disableImageEditingInDocuments`
218+
219+
The `mediaLibrary.disableImageEditingInDocuments` server configuration option is deprecated and will be removed in `release-2026-09`. It is introduced alongside [image editing in documents]({{< ref "#image-editing-in-documents-gift" >}}) as a temporary opt-out.
220+
203221
## Features :gift:
204222

223+
### Image Editing in Documents :gift:
224+
225+
Images can now be edited directly within a document. An "Adjust" button on each image placement lets users rotate images and apply colour adjustments (brightness, contrast, saturation) per placement, without affecting the original image or other documents that reference it.
226+
227+
{{< img src="release-2026-03-image-editing-adjust.png" alt="Adjust image" width="400" caption="The Adjust button lets users apply colour adjustments per placement." >}}
228+
229+
As a result, colour adjustments are no longer available in the media library. The only image modification that remains in the media library is pixelation. Pixelation continues to be applied globally to all image placements.
230+
231+
{{< img src="release-2026-03-image-editing-pixelate.png" alt="Pixelate image" width="400" caption="Pixelation remains in the media library and applies globally to all placements of the image." >}}
232+
233+
The new behavior is enabled automatically for all setups that have `use2025Behavior: true`. Once enabled, reverting to the previous behavior is not supported.
234+
235+
If newsrooms need time to adapt, image editing in documents can be temporarily disabled using `mediaLibrary.disableImageEditingInDocuments`. Note that this option is deprecated and will be removed in {{< release "release-2026-09" >}}. This option must be set before users start editing images in documents. Disabling it afterwards will not remove existing variants, which will continue to be applied in their respective placements.
236+
237+
This change is non-breaking for deliveries. Images can continue to be fetched by key as before. However, since an image can now have multiple variants, ensure you use `mediaLibraryApi.getAllKeysForMediaLibraryEntry()` when purging CDN caches after a media library entry is revoked or invalidated, as it returns all associated keys including any variant keys.
238+
239+
See [Image Editing in Documents]({{< ref "/guides/media-library/2025-behavior/#image-editing-in-documents" >}}) for details.
240+
241+
### Image Rotation :gift:
242+
243+
Journalists can now rotate images directly within a document. This is particularly useful for correcting a skewed horizon. Rotation is applied per placement, so the original image and any other documents that reference it remain unchanged. Since rotating an image changes its dimensions, any existing crops on that placement are reset automatically.
244+
245+
{{< img src="release-2026-03-image-editing-rotate.png" alt="Rotate image" caption="Images can be rotated per placement directly within a document." >}}
246+
205247
### Reuse Already Imported Media Source Items :gift:
206248

207249
When a media source item has already been imported, Livingdocs now reuses the existing media library entry instead of importing it again. This allows keeping media libraries free of duplicates when using media from external systems.
@@ -259,6 +301,7 @@ Here is a list of all patches after the release has been announced.
259301
### Livingdocs Server Patches
260302

261303
### Livingdocs Editor Patches
304+
262305
- [v123.10.8](https://github.com/livingdocsIO/livingdocs-editor/releases/tag/v123.10.8): fix(search): Limit query length and display understandable error
263306
- [v123.10.7](https://github.com/livingdocsIO/livingdocs-editor/releases/tag/v123.10.7): fix(metadata): Fix undefined property error in user needs form
264307
- [v123.10.6](https://github.com/livingdocsIO/livingdocs-editor/releases/tag/v123.10.6): fix: Fix errors for edge cases of certain configurations/behaviors
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
figure.img {
2+
margin: $space-m 0;
3+
4+
figcaption {
5+
@extend %font-s-xs;
6+
color: $color-grey-3;
7+
}
8+
}

0 commit comments

Comments
 (0)