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

Current view stretches image #981

Open
1 of 3 tasks
demiankatz opened this issue Apr 3, 2024 · 3 comments
Open
1 of 3 tasks

Current view stretches image #981

demiankatz opened this issue Apr 3, 2024 · 3 comments

Comments

@demiankatz
Copy link
Contributor

UV version:

 universalviewer@4.0.25

I'm submitting a:

  • bug report => please fork one of these codesandbox examples with a repro of your issue and include a link to it below
  • feature request => please use the user stories repo
  • support request => Please do not submit support requests here, use stackoverflow

Current behavior:
Sometimes the "current view" download option appears with inappropriate dimensions that cause the image to be stretched beyond its normal aspect ratio.

Expected behavior:
The "current view" option should always maintain an appropriate aspect ratio.

Steps to reproduce:
Go to the UV demo with a Villanova manifest loaded. Switch from 2-up to 1-up view using the icon near the top right. Open the download menu, and click the top "Current view" option under "Individual Pages" -- you should see a stretched version of the page image.

It's possible that behavior will vary based on screen resolution. When I reproduced the problem, I was using a 1360x768 display. The page image has dimensions of 2384x3000, but the "current view" option stretched the entire image to dimensions of 3471x2999. This problem does not appear to impact all images in all manifests, so it may be an edge case related to the specific aspect ratio of this object.

@demiankatz
Copy link
Contributor Author

For now, I have disabled the "current view" option in Villanova's instance using the downloadCurrentViewEnabled config setting. This option is not particularly useful for us, so I don't think we urgently need a fix. But obviously it would be good to fix this for those who do want the option.

@nicolasfranck
Copy link
Contributor

@demiankatz maybe it has something to do with any form of applied maximum width/height server side?

I see that the dimensions for https://iiif.library.villanova.edu/image/vudl%3A985207/27,102,2528,1499/2528,1499/0/default.jpg (applied dimensions are 2528,1499 as requested) are different from https://iiif.library.villanova.edu/image/vudl%3A985207/27,102,2528,1499/full/0/default.jpg (applied dimensions are 2357x1499), so I guess because the server applies some restrictions.

So my conclusion is: the applied height is the same in full size, but the width isn't. Maybe add maxWidth and maxHeight to your info.json? maxArea seems a bit vague, especially when the server applies it differently.

So in my opinion, the UV does it "correctly" (the requested size has the same dimensions as the width and height in the region), but the maxWidth and maxHeight are not set in the info.json for the UV to take into account.

Or am I missing something?

@demiankatz
Copy link
Contributor Author

@nicolasfranck, I'm not aware of any server-side width/height restrictions; we're using Cantaloupe, and it is not configured to impose limitations. I also don't have much control over info.json, since that is generated by Cantaloupe. Maybe there's a setting to adjust that behavior, but I'm mostly running with defaults.

I wonder if this is somehow related to #242, which has some characteristics in common with the problem here. I suspect the problem may be caused by some inconsistencies in the way we build our manifests; whether that's a problem on our end or in the UV may be hard to answer without a deeper dive into the spec and the code. For now, I'm pretty satisfied with just turning off "current view." ;-) I'm open to revisiting this when we have more time, but for now I think there are other higher priorities!

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