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

Return size of PDF page document #1612

Merged
merged 1 commit into from
May 18, 2023

Conversation

hrdl-github
Copy link
Contributor

@hrdl-github hrdl-github commented May 17, 2023

This is a rough approximation to be used by the caching mechanism. I assume one byte per character and a small constant size for coordinates. I don't know how much overhead the table and individual structures require.


This change is Reviewable

This is a rough approximation to be used by the caching mechanism.
Copy link
Member

@Frenzie Frenzie left a comment

Choose a reason for hiding this comment

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

lgtm

@Frenzie
Copy link
Member

Frenzie commented May 17, 2023

Hm, I guess that change causes this test to fail?

assert.are.same(kc_table.language, new_kc_table.language)

@hrdl-github
Copy link
Contributor Author

I'm not sure why. I don't have a working test setup, but executing the test manually in luajit by pasting the relevant variables produces the desired result. Do you have an idea what is happening?

@benoit-pierre
Copy link
Contributor

That test is flaky (because of possibly uninitialized memory).

@NiLuJe
Copy link
Member

NiLuJe commented May 17, 2023

That test is flaky (because of possibly uninitialized memory).

Did you pinpoint exactly where the issue lies?

@Frenzie
Copy link
Member

Frenzie commented May 17, 2023

I told the tests to run again and they seem to have passed, so that would indeed seem to be slightly flaky. I'm not sure I've ever noticed it flaking before, or perhaps I just tune it out when I know it can't possibly be related which may not necessarily be the case here although it's unlikely.

@benoit-pierre
Copy link
Contributor

That test is flaky (because of possibly uninitialized memory).

Did you pinpoint exactly where the issue lies?

Not yet.

@NiLuJe
Copy link
Member

NiLuJe commented May 17, 2023

I told the tests to run again and they seem to have passed, so that would indeed seem to be slightly flaky. I'm not sure I've ever noticed it flaking before

It's been borked for years ;).

It used to be way way worse because at least one of the copies used to be more obviously borked (it wasn't null terminated), but it's still random today (and I think that's one of the rare "random" test failure that I could ever actually reproduce locally; but it's been a while since I tried [the fact that it requires setting up tesseract to run doesnt help ;p]).

So, yeah, something's fishy with that one, for sure.

@benoit-pierre
Copy link
Contributor

See #1613.

@Frenzie Frenzie merged commit eb34140 into koreader:master May 18, 2023
@hrdl-github hrdl-github deleted the cache_pdf_pages branch May 18, 2023 07:26
Frenzie added a commit to Frenzie/koreader that referenced this pull request May 18, 2023
Frenzie pushed a commit to koreader/koreader that referenced this pull request May 18, 2023
Updating the selection queries the same page tens of times per second. This prevents KOReader from keeping up with high-frequency input event streams.

Fixes #10443. Relies on koreader/koreader-base#1612.
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.

4 participants