Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debug system for users spinning up their own system to have own images #519

Open
jrosindell opened this issue Mar 9, 2022 · 2 comments
Open

Comments

@jrosindell
Copy link
Member

Notes from Yan sent by e-mail saved here...

The images thing is interesting, actually. There are a number of organisations which might like to have a OneZoom tree with only their images on it. I imagine this would be quite easy to do, now that we have a docker image. Here’s how I think we could do it:

  1. We require the “image partner” to place their images in a folder, in jpeg format, recommended to be square, and named either by the species name (e.g. Homo_sapiens.jpg) or by the OTT (ott_770315.jpg). We could also allow an image rating to be encoded like this, by prefixing the name with a number, e.g. 45000_Homo_sapiens.jpg. We also state that the IPTC "Copyright Notice”, “Credit Line”, and "Licensor URL" fields can be filled out for use in the OneZoom display.

1a) We also allow images to be in a subfolder as long as that subfolder is named using one of the OpenTree TNRS concepts (https://github.com/OpenTreeOfLife/germinator/wiki/TNRS-API-v3#contexts), e.g. “Land_plants”.

  1. The image partner downloads the “OneZoom-complete” docker image and runs it, specifying the image folder above as a volume mount

  2. The image partner logs in to the docker image and runs a (new) script that does the following:

3a) Look in the mounted image volume and go through the files and folders. For each jpg file, we snip off any leading number. Then any names that does not start with “ott_” is looked up using the OpenTree TNRS (with context, if necessary) and mapped to OTTs.

3b) We (optionally) delete the existing images in images_by_ott

3c) All images that are have an OTT or have been mapped to OTTs in step 3 are added to the images_by_ott table:

  • images_by_ott.src is set to src_flags[‘bespoke’] (i.e.1)
  • images_by_ott.src_id is allocated sequentially.
    We must also move the jpg file to a new file of that name within the images hierarchy
  • images_by_ott.rating is set to the value form the filename (if any, otherwise 25000)
  • images_by_ott.url is set to the IPTC "Licensor URL” (if any), and we also have a parameter in the script to set the default
  • images_by_ott.rights is set to the IPTC "Credit Line” (if any), and we also have a parameter in the script to set the default
  • images_by_ott.license is set to the IPTC "Copyright Notice” (if any), and we also have a parameter in the script to set the default
  • all images are marked as “verified”. We have a parameter which is normally unset which, if set, flags all images as PD

3d) We rationalise all the image flags in case we didn’t delete the existing images in step 4

3e) The script runs picProcess.py

  1. The user now commits a new image (as per https://github.com/OneZoom/OZtree-docker#iucn-extinction-risk-data), and ca re-run it whenever they like.
@hyanwong
Copy link
Member

hyanwong commented Mar 9, 2022

This is all coded up and pushed to main (see #469). There is currently a bug in the pathway, though.

@hyanwong hyanwong changed the title System for users spinning up their own system to have own images Debug system for users spinning up their own system to have own images Mar 10, 2022
@hyanwong
Copy link
Member

The current problem is here: OneZoom/OZtree-docker#1 (comment)

It would be good if @lentinj could fix this as part of his sprint.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants