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

Adjustments for upstream upgrades #253

Merged
merged 8 commits into from Jan 19, 2024
Merged

Adjustments for upstream upgrades #253

merged 8 commits into from Jan 19, 2024

Conversation

dothinking
Copy link
Collaborator

@dothinking dothinking commented Jan 18, 2024

Some adjustments to handle the side effects of upgrading PyMuPDF from 1.23.8 to 1.23.14+, e.g.,

And some other tweaks, e.g., remove Github Action for publishing docs to Github page.

@JorjMcKie
Copy link
Collaborator

A fix is identified already and will lead to a new PyMuPDF version - hopefully even today.

@jamie-lemon
Copy link
Collaborator

jamie-lemon commented Jan 18, 2024

Thanks Train! ( hope you don't me calling you "Train" - seen you use it a few times, please let me know ) . It is possible that we will have fixed some of the issues you are seeing in an imminent release of PyMuPDF.

Adding Harald & Julian here as they should be aware of the behaviour change for Rect & Pixmap - I think we know about the Pixmap one already. I guess if the issues are both fixed in PyMuPDF 1.23.16 then you may want to rework this PR. @JorjMcKie , @julian-smith-artifex-com What do you think?

@dothinking
Copy link
Collaborator Author

@jamie-lemon "Train" sounds friendly for me, as it's a name used in my college time. 😁

Regarding this PR, once released PyMuPDF 1.23.16, I just need to delete the version restriction in requirements.txt, the rest should be OK.

Copy link
Collaborator

@jamie-lemon jamie-lemon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just didn't understand one of the comments.

factor (float, optional): Threshold of overlap ratio, the larger it is, the higher
probability the two bbox-es are aligned.
text_direction (bool, optional): Consider text direction or not.
True by default,from left to right if False.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't really understand what this means "True by default, from left to right if False".

So if the text_direction is True then we do consider text direction - okay, but if it is False then we don't consider text directions, however when I read this it seems like False means we consider a left to right text direction as it says "from left to right if False". I'm confused!

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't read any contradictions between your thoughts -> don't consider text directions -> ignore real text directions -> use default text directions -> the most common case, horizontal, i.e., from left to right.

Appreciated if you help a precise wording.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Per my understanding, don't consider text directions, means to use default text direction, which is from left to right.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose the bit I don't understand then is if True then what is the text direction? Basically:

False = from left to right
True = ?

Also if we are False then we do consider the text direction don't we (left to right)? Which is why text_direction (bool, optional): Consider text direction or not. confuses me!

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I probably understand your confusion. When False, the words from left to right does not mean to text direction, but the default direction for "horizontal". I should just keep True by default and delete the rest.

image

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay - yes please just delete to avoid the confusion.

factor (float, optional): threshold of overlap ratio, the larger it is, the higher
probability the two bbox-es are aligned.
text_direction (bool, optional): consider text direction or not.
True by default, from left to right if False.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See previous comment.

@julian-smith-artifex-com
Copy link
Collaborator

FYI, PyMuPDF-1.23.16 has just been released, and fixes the Pixmap issue pymupdf/PyMuPDF#3058.

The fitz.Rect problem was introduced in 1.23.9 and fixed in 1.23.13 and later.

Hope that helps.

@jamie-lemon jamie-lemon merged commit 5e48dbe into master Jan 19, 2024
3 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.

None yet

4 participants