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

mupdf: allow memory streams to load resources #2002

Merged
merged 1 commit into from
Dec 11, 2024

Conversation

TnS-hun
Copy link
Contributor

@TnS-hun TnS-hun commented Dec 8, 2024

Use fz_open_document_with_stream_and_dir instead of fz_open_document_with_stream to allow MuPDF to load resources (images and CSS) when it is loading a HTML document from a memory stream.


This change is Reviewable

Use fz_open_document_with_stream_and_dir instead of fz_open_document_with_stream to allow MuPDF to load resources (images and CSS) when it is loading a HTML document from a memory stream.
TnS-hun added a commit to TnS-hun/koreader that referenced this pull request Dec 8, 2024
Pass the directory that contains the dictionary's ifo file to Mupdf.openDocumentFromText to allow MuPDF to display images referenced by HTML dictionaries.

Depends on: koreader/koreader-base#2002
Fixes: koreader#12628
local mupdf_doc = {
doc = W.mupdf_open_document_with_stream(ctx, magic, stream),
doc = W.mupdf_open_document_with_stream_and_dir(ctx, magic, stream, archive),
Copy link
Member

Choose a reason for hiding this comment

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

This is fine if it's null?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, it is fine with null. The previously used fz_open_document_with_stream just a single line function that uses null as the archive.

TnS-hun added a commit to TnS-hun/koreader that referenced this pull request Dec 9, 2024
Pass the dictionary's res directory to Mupdf.openDocumentFromText to allow MuPDF to display images referenced by HTML dictionaries.

Depends on: koreader/koreader-base#2002
Fixes: koreader#12628
TnS-hun added a commit to TnS-hun/koreader that referenced this pull request Dec 9, 2024
Pass the dictionary's res directory to Mupdf.openDocumentFromText to allow MuPDF to display images referenced by HTML dictionaries.

Depends on: koreader/koreader-base#2002
Fixes: koreader#12628
@Frenzie Frenzie merged commit 61ca7a7 into koreader:master Dec 11, 2024
4 checks passed
Frenzie added a commit to koreader/koreader that referenced this pull request Dec 11, 2024
Includes:

* sqlite: update to 3.47.2 (koreader/koreader-base#1999)
* mupdf: fix finalizers (koreader/koreader-base#2001)
* mupdf: allow memory streams to load resources (koreader/koreader-base#2002) for #12877
* thirdparty/lua-Spore 0.3.4 (koreader/koreader-base#2003)
Frenzie pushed a commit to koreader/koreader that referenced this pull request Dec 12, 2024
Pass the dictionary's res directory to Mupdf.openDocumentFromText to allow MuPDF to display images referenced by HTML dictionaries.

Depends on: koreader/koreader-base#2002
Fixes: #12628
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.

2 participants