Transformer configuration should target file formats, not models #81

Open
opened 2026-09-27 15:17:36 +00:00 by scossu · 0 comments
Owner

Transformer configurations are currently wired to content models. That does not reflect the practical reality that, in the overwhelming majority of cases, a file needs to be transformed to a specific presentation or thumbnail based on its format, regardless of the model(s) it is associated to.

For example, a PDF should always generate a static image using Poppler or Magick, whether it is classified as a still_image_file or as a document_file.

Therefore, the current transformers configuration sections should be moved out of the schema files and should have their own separate configuration; likely an associative array of MIME types (Pocket Archive uses libmagic) and transformer directives. The MIME types should account for wildcards, to avoid listing myriads of file formats all with the same configuration.

Specific configurations taking content model and file format may be a possible use case, but too rare to be in scope for this change.

Transformer configurations are currently wired to content models. That does not reflect the practical reality that, in the overwhelming majority of cases, a file needs to be transformed to a specific presentation or thumbnail based on its format, regardless of the model(s) it is associated to. For example, a PDF should always generate a static image using Poppler or Magick, whether it is classified as a `still_image_file` or as a `document_file`. Therefore, the current `transformers` configuration sections should be moved out of the schema files and should have their own separate configuration; likely an associative array of MIME types (Pocket Archive uses libmagic) and transformer directives. The MIME types should account for wildcards, to avoid listing myriads of file formats all with the same configuration. Specific configurations taking content model *and* file format may be a possible use case, but too rare to be in scope for this change.
scossu added this to the v1.1.0 milestone 2026-09-27 15:17:36 +00:00
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
ktx/pocket_archive#81
No description provided.