Remove the width, height and server from CreateImage
While working on teklia/mlaas/peregrine!44, @vrigal hit an undocumented behavior of CreateImage
: when an internal user sends width
and height
, the image is immediately marked as Checked
. This causes the response serializer to not include the s3_put_url
, because it only includes it for non-checked images on the local server, preventing the Peregrine script from uploading the image.
Valentin opened !1852 (closed) to cause a discussion on the issue, but this did not sound like a great solution because the concept of internal users will be removed at some point in time. We dug around and found that the width
, height
and server
attributes on CreateImage
, as well as the implicit Checked
, have been added in !396 (merged) specifically for the Balsac S3 import: https://trello.com/c/NMvcE6Bt/994-support-jp2000. The arguments were used in tasks!18 (merged).
The current uses of CreateImage
found in code.vpn are here:
- Only
hash
- https://gitlab.com/teklia/data/scripts/-/blob/8b0713992a347aa30f0244d1fe5082467f486bbd/arkindex/DIVA-HisDB/import_diva_pixel_annotations.py#L51
- https://gitlab.com/teklia/arkindex/tasks/-/blob/e2b60fbc394d1bfcb376316a706fd1c22425ac7f/arkindex_tasks/import_transkribus.py#L86
- https://gitlab.com/teklia/arkindex/tasks/-/blob/e2b60fbc394d1bfcb376316a706fd1c22425ac7f/arkindex_tasks/import_files/base.py#L85
-
hash
,path
-
hash
,width
,height
-
hash
,width
,height
,server
,path
The export_arkindex
command in Socface used all of the parameters in CreateImage
just to be able to create an image for the spider's own IIIF server, something which should instead be done using CreateIIIFURL
; CreateImage
should only be used for the local imageserver.
The publish.py
script in the eScriptorium text alignment project sends a width
and height
and expects an s3_put_url
, which is probably just because nobody tried to run the script with an internal user and never hit the case where the URL is None. The script then updates the image to Checked
manually, so removing the width
and height
would not affect it at all.
We could therefore remove width
, height
and server
and greatly simplify the behavior of CreateImage, which will also makes things simpler in #1164.