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

959 configurable width height caching #1029

Merged
merged 39 commits into from
Jul 11, 2024

Conversation

alxp
Copy link

@alxp alxp commented Jun 25, 2024

GitHub Issue: (link)

  • Other Relevant Links (Google Groups discussion, related pull requests,
    Release pull requests, etc.)

What does this Pull Request do?

Resolves #959 by:

What's new?

adding an action for retrieving a TIFF or JP2'ss image dimensions which can be added as a context reaction when the media is uploaded, off-loading the work from the IIIF Manifest style plugin.

Fixes the logic in the IIIF Manifest Views style plugin to let a user choose custom Width and Height fields for Large Images, while still falling back on field_width and field_height if they exist.

Puts the Structured Text Field as well as custom Width and Height fields under an Advanced closed detail section to simplify the IIIF Manifest Style plugin's UI. This update also includes an update hook to handle the new config key.

Updates to the Islandora IIIF README to include instructions for using the new action and removing old terminology.

  • Does this change add any new dependencies? No
  • Does this change require any other modifications to be made to the repository
    (i.e. Regeneration activity, etc.)? No
  • Could this change impact execution of existing code? No

How should this be tested?

On a fresh Islandora Starter Site:

  1. Create a new Repository Item with Paged Content model.
  2. Add a child object with model Page and File media to which you will upload a TIFF file.
  3. Edit the Original File media and observe that the Width and Height fields are empty.
  4. If the Paged Content object you created was Node ID 1, go to /node/1/book-manifest-original. Check that the Width and Height attributes of the canvas are populated.

image
5. Now go to the Original File media again and click Edit. You should see that the Width and Height fields now contain the values as seen in the manifest in step 4.

To test the action:

  1. Go to admin/config/system/actions
  2. Choose "Add image dimensions retrieved from the IIIF server" from the Create Complex Action drop-down and then click Create.
  3. Enter Original File for the Source Media Use term.
  4. Choose media -- file -- Width and Media -- File -- Height for the corresponding configuration values and click Save.

image

  1. Go to admin/structure/context, and click Duplicate oon the Page Derivatives row.
  2. Name the new context something like "Retrieve Page Dimensionss". and edit it.
  3. This is the tricky bit, delete 'Original File' from the 'Media has term with URI' field and replace it with Service File. The explanation for this is that to retrieve a file from the IIIF server, it must be part of an Islandora Media that has been fully created and saved and given a URL. This hasn't happened yet when Original File derivatives are being created, so we need to hang our action onto a derivative that is created after the original one.
  4. Under Reactions, deselect the existing actions and select "Add i mage dimensions from IIIF sserver" and click Save and continue.

image

  1. Go back to your Paged Content object and add another child with a File media, to which you should upload another TIFF or JP2 file.
  2. Without going to the Original File Book Manifestt, make sure that a service file has been generated, then click Edit on the Original File media.
  3. Ensure that the Width and Height fields are populated with thee correct values from the file.

image

Documentation Status

  • Does this change existing behaviour that's currently documented? Yes

Updated the README in islandora_iiif with instructions.

Additional Notes:

Any additional information that you think would be helpful when reviewing this
PR.

Replaces an outdated PR #983 . Improvements from code review comments from that PR have ben incorporated into this one.

Interested parties

Tag (@ mention) interested parties or, if unsure, @Islandora/committers

alxp and others added 28 commits June 8, 2024 20:06
Co-authored-by: Adam <607975+adam-vessey@users.noreply.github.com>
@aOelschlager aOelschlager self-requested a review June 26, 2024 17:22
@alxp
Copy link
Author

alxp commented Jul 10, 2024

This is ready for you to test @aOelschlager

alxp and others added 3 commits July 10, 2024 13:58
Co-authored-by: Adam <607975+adam-vessey@users.noreply.github.com>
Co-authored-by: Adam <607975+adam-vessey@users.noreply.github.com>
Copy link

@aOelschlager aOelschlager left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Followed the testing instructions and I was able to populate and view the width and height of both tiff and jp2 files.

@aOelschlager aOelschlager merged commit 7bae08f into 2.x Jul 11, 2024
27 checks passed
@aOelschlager aOelschlager deleted the 959-configurable-width-height-caching branch July 11, 2024 22:12
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

Successfully merging this pull request may close these issues.

Improve performance of IIIF Manifest generation
4 participants