Issue in finding the correct rotation for rotated image #4416
Unanswered
mkustererenbw
asked this question in
Looking for help
Replies: 2 comments
-
I will try to bump it one time as I have still failed to solve this. Maybe someone has an idea or can hint to what I'm missing. Thanks :) |
Beta Was this translation helpful? Give feedback.
0 replies
-
You're only sharing pictures here - nothing we could look up in the PDF or image itself. So we have to take a shot in the dark: |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
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