kitodo-production icon indicating copy to clipboard operation
kitodo-production copied to clipboard

Export with images: no error on wrong image count

Open henning-gerhardt opened this issue 2 years ago • 6 comments

Describe the bug If you export a process (as automatic task, using the export button or calling the KitodoScript for exporting) where the amount of images are changed on a correction workflow and some body did not correct this in the meta data editor the export is successfull and the workflow is future processed instead of stopped. This will create a lot of issues for any action after the export task and the data is depending on correct export data.

To Reproduce Steps to reproduce the behavior:

  1. Process a process like normal
  2. Start a correction workflow in the meta data editor
  3. Add / Remove some images outside of the meta data editor and close the correction workflow successful
  4. Do not correct the image pagination in the meta data editor
  5. Export the process through the KitodoScript call, Export button click or let the workflow process the export as automatic task

Expected behavior Amount of paginated images must be equal to the amount of image files in the defined image directory or the export should not start or abort without creating the export xml files and this is important too: if the export is started by a task the task should remain open!

Release 3.4.4-SNAPSHOT

henning-gerhardt avatar Aug 08 '22 09:08 henning-gerhardt

This issue is not related to #5281 as this can happen every time.

henning-gerhardt avatar Aug 08 '22 09:08 henning-gerhardt

Please note that there may be media units where there are not all configured variants backed with files. For example for a phonographic recording, front cover and back cover will not have audio, and side A and side B may or may not have images. This should not lead to validation errors.

matthias-ronge avatar Aug 08 '22 11:08 matthias-ronge

If your mentioned scenario, @matthias-ronge , should be supported then this should somehow configurable. For our use case we need this strong check as every action after the export is done will fail and cause a lot of manual corrections.

henning-gerhardt avatar Aug 08 '22 11:08 henning-gerhardt

Yes, I think this should be configurable. There could be a switch in the folder settings for each folder individually, if the number of images must match for this folder in case of export, or not.

Note: If it doesn’t match, there should be a visible error before export starts (like: “Export cannot start because ...”) and not a say “Export started” and then only find a “Crash” in the task manager.

matthias-ronge avatar Aug 08 '22 11:08 matthias-ronge

Your solution sound right but displaying an error message on an automatic task would be not so easy except this message appear on the task manager and an user is looking for this message which is not every time the case: so this message must appear in the log so you can react on this with an outside running program. But it is very important that this task is not going into the done state and must stay on an open state.

henning-gerhardt avatar Aug 08 '22 11:08 henning-gerhardt

I want to add, that it is even possible to export a process without image files.

I know that hierarchical processes do not contain image files and it is absolutely necessary that these processes can be exported without image files.

But for the other processes, a validation is conducted in the metadata editor that warns that the process does not contain image files. That validation rule, which must be connected with the media type or doc type could be used to abort export of incomplete processes.

andre-hohmann avatar Aug 10 '22 11:08 andre-hohmann