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

Add ability to set a rotation on SSIV #5

Merged
merged 1 commit into from
Aug 23, 2024

Conversation

dwagner-gh
Copy link

Why does this PR exist?

This library is quite handy, but it seems to lack the ability of dealing with rotated images. For example images having EXIF rotation data. In order to keeps things simple, the SSIV should have a rotation field and apply that to the tiles it's displaying.

How does the PR solve this?

This PR adds a new enum called ImageRotation, it has fixed values of 90 degree increments. SubsamplingScaleImageView has been extended by a imageRotation field of type ImageRotation and with a default value of ImageRotation.ROTATION_0. This value can be changed via SubsamplingScaleImageView.setImageRotation(). In order for the rotation to apply getEffectiveSWidth() and getEffectiveSHeight() have been added to account for the rotation when using sWidth and sHeight.

Further Reading

I based this PR on the original repo. I left out the EXIF parsing, it has to bee done externally, and once the rotation is determined, users can call SubsamplingScaleImageView.setImageRotation().

- SSIV has an imageRotation field that can be changed, no EXIF parsing is done
@arkon arkon merged commit faa0a72 into tachiyomiorg:main Aug 23, 2024
2 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