Skip to content
This repository has been archived by the owner on Jan 29, 2025. It is now read-only.

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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants