Some images for https://arcadia.cokodemo.net/ are missing when exported to Flax
Arcadia has a test site on https://arcadia.cokodemo.net/. Kotahi is on https://kotahi.arcadia.cokodemo.net/
Kotahi version 2.2.1
Some articles have images that are not transported to flax.
Flax is setup to download every images of the articles, add them to the server and change the url.
in Kotahi, the image would look like this:
<img
src="https://editoria-s3.cloud68.co/kotahi-arcadiascience/f091472fc360_medium.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=guaYNudoODZCOqSugRMoEjdeyWKEWF%2F20240126%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20240126T062452Z&X-Amz-Expires=86400&X-Amz-Signature=c4ef9b4a082c4ec1359f2c911aac1085a35da3359d187ae3d1c85c2e4540ee1a&X-Amz-SignedHeaders=host"
alt="Image1.png"
data-id=""
data-fileid="0e0010d2-8eb4-4c85-8c92-3ae4ac3d734c"
contenteditable="false">
Before being served in Flax, the image is downloaded and renamed following this pattern:
/${groupID}/assets/images/assets/${article.shortId}-${image.altText}.${filetype}
This is the working result in flax.
<img
src="/journal/assets/images/articles/206-Image1.png"
alt="Image1.png"
data-id=""
data-fileid="0e0010d2-8eb4-4c85-8c92-3ae4ac3d734c">
In the Arcadia case, there are two kind of issues:
image pasted from another service (in that case pubpub)
The image gets the same html from where it’s been downloaded from:
<img src="https://resize-v3.pubpub.org/eyJidWNrZXQiOiJhc3NldHMucHVicHViLm9yZyIsImtleSI6IjEwcG8yaHdpL0ZpZzEtV29ya2Zsb3dAMngtMjE2OTU0Mjc1NTk0ODIucG5nIiwiZWRpdHMiOnsicmVzaXplIjp7IndpZHRoIjo4MDAsImZpdCI6Imluc2lkZSIsIndpdGhvdXRFbmxhcmdlbWVudCI6dHJ1ZX19fQ=="
alt=""
data-id=""
contenteditable="false">
Since the alt
text is empty, flax can’t recreate the file and the download link. As the result, in flax, we get this:
<img src="/journal/assets/images/articles/220-" alt="" data-id="">
This could be fixed by ** not using alt
text for renaming and downloading file, but instead reuse the filename with the article.shortID prefix to avoid duplicated name**
This would allow us to have alt text for image for accessibility reasons anyway.
Images that are not downloaded to Flax.
The image has the following markup and is visible in Kotahi
<img src="https://editoria-s3.cloud68.co/kotahi-arcadiascience/ffbb3a03b1eb_medium.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=guaYNudoODZCOqSugRMoEjdeyWKEWF%2F20240126%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20240126T063253Z&X-Amz-Expires=86400&X-Amz-Signature=6a5ebebe413eb11f82c23086f55cb99a83eeb2b3bae27e0b3264224fa2b5fef4&X-Amz-SignedHeaders=host"
alt="Fig1-Workflow@2x.png"
data-id="6ffbc0e8-736f-4b08-bca8-d5134ae3e9c0"
data-fileid="91bc517f-8d82-43c3-b876-142a0ad9295b"
contenteditable="false">
in Flax:
<img src="/journal/assets/images/articles/220-Fig2-ProteinCartography_MK10_example.png"
alt="Fig2-ProteinCartography_MK10_example.png"
data-id="194afdb7-c007-4d1f-bad9-19c76e06ab68"
data-fileid="7fedc99d-18ac-4dc4-b885-218bb3bb181a">
The url has a error 500 (internal error) and not a 404.
I asked for cloud68 for server access to see what happens in the Flax microservice.