Skip to content

Add minimum image width to download options#1716

Merged
jamesmisson merged 7 commits intoUniversalViewer:devfrom
jamesmisson:min-download-width
Apr 2, 2026
Merged

Add minimum image width to download options#1716
jamesmisson merged 7 commits intoUniversalViewer:devfrom
jamesmisson:min-download-width

Conversation

@jamesmisson
Copy link
Copy Markdown
Contributor

This adds a minImageWidth config option to the download dialogue that checks for a minimum image width before offering the option to download the image.

It gets the maxWidth as usual, then checks this against the minImageWidth. If the maxWidth is greater than the minImageWidth, it gets displayed as a download option. If it's smaller, no download is allowed.

E.g. this manifest has a maxWidth of 512 on the images and needs download restricted according to the item's RAQ ID: https://stage.bl.digirati.io/manifests/ark:/81055/vdc_100170823639.0x000001

Setting the download dialogue options to the following will display the 'no download available' message in the download dialogue:

{
  "modules": {
    "downloadDialogue": {
      "options": {
        "minImageWidth": 513
      }
    }
  }
}

@jamesmisson jamesmisson requested a review from demiankatz March 27, 2026 17:16
@vercel
Copy link
Copy Markdown

vercel bot commented Mar 27, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
universalviewer Ready Ready Preview, Comment Apr 2, 2026 3:37pm

Request Review

@vercel
Copy link
Copy Markdown

vercel bot commented Mar 27, 2026

@jamesmisson is attempting to deploy a commit to the Universal Viewer Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Copy Markdown
Contributor

@demiankatz demiankatz left a comment

Choose a reason for hiding this comment

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

Thanks, @jamesmisson, see below for a few suggestions (one stylistic, the other perhaps slightly more significant). In any case, nitpicks aside, this makes sense to me in principle!

Co-authored-by: Demian Katz <demian.katz@villanova.edu>
Co-authored-by: Demian Katz <demian.katz@villanova.edu>
Copy link
Copy Markdown
Contributor

@demiankatz demiankatz left a comment

Choose a reason for hiding this comment

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

Thanks, @jamesmisson, the logic fixes look good -- now we just need to agree on the best solution for the constant. I'm really fine with either of my proposed approaches, but I think we should do one or the other.

Copy link
Copy Markdown
Contributor

@demiankatz demiankatz left a comment

Choose a reason for hiding this comment

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

Code all looks good now, but it occurs to me that we need to add this to manual/CONFIG.md to keep the documentation up to date! Do you mind doing that before we merge this?

@jamesmisson
Copy link
Copy Markdown
Contributor Author

Good point, thanks @demiankatz

Copy link
Copy Markdown
Contributor

@demiankatz demiankatz left a comment

Choose a reason for hiding this comment

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

This looks ready to go now!

@jamesmisson jamesmisson merged commit 1f2a35d into UniversalViewer:dev Apr 2, 2026
4 of 5 checks passed
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.

2 participants