Skip to content

Update scaling to ensure parity with dotnet output#29

Open
donaldgray wants to merge 1 commit intomasterfrom
feature/scale_dimensions_tweak
Open

Update scaling to ensure parity with dotnet output#29
donaldgray wants to merge 1 commit intomasterfrom
feature/scale_dimensions_tweak

Conversation

@donaldgray
Copy link
Member

In production use, noticed that there are differences between the sizes calculated by the iiif-net dotnet library used by Protagonist and the sizes calculated by Appetiser.

Altered the scaled_dimensions_to_fit() function to use method from "old" Appetiser equivalent function https://github.com/dlcs/appetiser/blob/1.5.0/app/jp2/image.py#L218-L241 and used similar handling to dotnet code for w, and ,h.

For reference the dotnet lib functions are:

Note

How can we extend the test suite to allow us to test this function to ensure any future changes don't break anything (e.g. if we allow mutating size-parameters?


@tomcrane conducted some tests: https://github.com/tomcrane/appetiserscale/blob/main/8-b-numbers.txt to check fix, based on https://github.com/tomcrane/appetiserscale/blob/main/test.py#L80

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.

1 participant