Issue in finding the correct rotation for rotated image #4416
Unanswered
mkustererenbw
asked this question in
Looking for help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello together,
I am currently investigating an issue in my application where I the extracted image from a document is rotated.
In short, the problem is that I extract a rotation of 90° while it should be -90° (more information following).
Following these discussions here
#1297
#385
#1896
and the docs (https://pymupdf.readthedocs.io/en/latest/app3.html#imagetransformation)
I tried the following:
page.get_text("dict")
as bytesI used the rot-detector-script from here for this: #385
3. Use the rotation information in order to transform the image:
After that, the image gets rotated, however, the rotation should be -90° while the extracted rotation is 90°.
Since it might be interesting, the values for transform and shrink and shrink*transform
Here are the images for better reference
Desired (-90°)

How it's extracted with my code (90°)

The original image from bytes

The screenshot in the pdf (-90°)

Am I missing something? I do not need to take the inverse, right? Thank you in advance.
Beta Was this translation helpful? Give feedback.
All reactions