inveniosoftware / invenio-rdm-records

DataCite-based data model for InvenioRDM flavour.
https://invenio-rdm-records.readthedocs.io
MIT License
15 stars 81 forks source link

iiif: extract image dimensions (also) on publish using `RecordFilesProcessorComponent` #1749

Open slint opened 1 month ago

slint commented 1 month ago

We're currently running image dimensions (width/height) extraction via the FileProcessorComponent in invenio-records-resources. This is useful to "pre-calculate" the dimensions while the record is still a draft and just copy over the result on publish.

Given though that this code runs in an async Celery task right after the file upload, we have the following issues:

To avoid this, we can use the new RecordFilesProcessorComponent, which runs on publish and can make sure to send off a task for calculating the metadata on the published record's files.