images management (essential tasks)

This is the issue that will compile requirements regarding images for the beta milestone.

Background

So far, we have been managing images using file names and folder names (admin uploads the images to the server using FTP) without any information about the images in the database. In order for us to be able to develop a system where editors can submit or edit images, or have a better grasp of what digital assets we have for one artifact or more, we need to have more control over the images and we want to do this with a database table.

Assets

CDLI manages 3 types of virtual digital assets: Raw images (not the format, meaning unprocessed images), archival (high-quality processed images) and web (to display on the website). Concerning the web visual assets, we have 4 main types: photo, photo detail, line art, line art detail. We also manage rti surfaces (need multiple jpg per surface) and 3d models (required a texture and a model file). We also have pdfs and more rare photo types ( see file names in the photo folder). It is always assumed that there is a thumbnail for all of the visual assets which are images (see the folder structure lineart, pdf, photo, ptm (that's the rti images), svg, vcmodels and thumbnails (tn_lineart, tn_photo)).

Display

For hints on how the images should be displayed, the current website it always a good bet, see any artifact using https://cdli.ucla.edu/Pxxxxxx. The code is also available in the master branch of the framework. On the search results page and on the artifact single view, we show the "main" image of the artifact. This would be the "photo" type. But if it's not available, there is a sequence in which the other types of images can be chosen as the main: photo, line art, photo detail, line art detail, ... etc. Display must be done according to access. We currently use a nginx rule to redirect artifact images requests to a controller so access can be evaluated before serving the image to the user.

Objectives

The objectives of this issue are to put in place the infrastructure so displaying the web images and checking access will be done through the images table. This will also require minimal add / edit / delete functionality. A bonus objective is preparing a page that will harvest information about orphan web images so the admin can add them to the images table.

Tasks

General

  • Populate the images table with minimal information (image type, artifact id, permissions) so it will be possible to work on the other tasks in this issue
  • Add a link from the artifact page to the edit images page for the artifact. The link should only be visible to admins and editors (roles 1 and 2).

Display #809 (closed)

  • Display images and link to images based on the images table
    • On the single artifact view
    • On the search results expanded view
    • Make sure access is verified first
    • Display main image
    • Display no image logo if no image
    • Display links to other visual assets, only those available for this artifact

Manage / Edit

  • prepare an index page for the images controller
    • list orphan files from the /dl/ folder with management options
      • Remove (with a warning before deleting officially)
      • Link (add the image to the image db, associated with the artifact number of the filename)
      • View (admin should open the image when clicking on the file name, then can there look at it, right click to download etc.)
      • Show the thumbnail and a link to the related artifact
    • Upload form (this will be for single images for now, we can improve it to upload rti, 3d etc later)
      • The file name should dictate the type of image and the artifact to which it will be linked
      • create thumbnail
      • Add image to the appropriate folder in /dl
      • Add image to the images table
      • Permission settings should be based by default on the artifact permission settings
  • Edit associated images
    • at /artifacts/<id>/images list images related to this artifact
    • For now, make it possible to delete images ( remove from dl and from images table)

The upload & edit issues is dependent on #812 (closed)

Edited by Émilie Pagé-Perron