-
Notifications
You must be signed in to change notification settings - Fork 104
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 1.12 #577
MuPDF 1.12 #577
Conversation
… unused with and height
Requires changes to PdfDocument:saveHighlight too (that is outside of base).
Closes #562. |
thirdparty/mupdf/CMakeLists.txt
Outdated
|
||
# TODO: ignore shared git submodules built outside of mupdf by ourselves | ||
# https://git.ghostscript.com/mupdf.git is slow, so we use the official mirror on GitHub | ||
# v1.12 isn't tagged, so we refer to it with a hash |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The tag 1.12.0
seems to have been added two days ago, which I think is a lot more legible than that hash below. ;-)
The shellchecks speak for themselves:
Then there's Android. Setting up a basic Android build system is fairly easy ( Thanks for all the work! |
Great work! Thanks for keeping this giant dependency uptodate :) |
thirdparty/mupdf/CMakeLists.txt
Outdated
@@ -69,7 +69,7 @@ ep_get_source_dir(SOURCE_DIR) | |||
ko_write_gitclone_script( | |||
GIT_CLONE_SCRIPT_FILENAME | |||
https://github.com/ArtifexSoftware/mupdf.git | |||
b7749e563f93160de82c97fe34fb3fb0d3396304 | |||
tags/1.12.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You forgot to remove the comment up above. ;-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:)
Alright, I have a few minutes now. I ascertained that it seems to be working on PC and building for Android. Should I also test it on Android or were you already able to? |
I just built it on Android. |
I tried to build the apk with
|
It seems to be working. :-) I'll hold off on merging another day or two. I haven't been able to read it properly yet myself. |
@TnS-hun are you able to run |
@houqp: that was the problem, ant wasn't installed. I should've read the readme more carefully. I tried to run the resulting apk with Genymotion Android Emulator but it didn't start. I tried the last two KOReader releases too but got the same result. |
@TnS-hun On PC I'd use x86 builds. Anyway like I said wfm after your patch. :-) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did I miss simple-out.pdf being used in the unit tests somewhere or is that an accidental include?
cdecl_type(fz_text_sheet) | ||
cdecl_struct(fz_text_sheet_s) | ||
cdecl_func(mupdf_new_text_sheet) | ||
cdecl_func(fz_drop_text_sheet) // NOTE: libk2pdfopt uses old fz_free_text_sheet symbol |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about these comments? Do they no longer apply?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The fz_drop_text_sheet function no longer exists.
I don't think those comments are relevant anymore because libk2pdfopt is built without using MuPDF (HAVE_MUPDF_LIB).
cdecl_type(fz_page_block) | ||
cdecl_struct(fz_text_page_s) | ||
cdecl_func(mupdf_new_text_page) | ||
cdecl_func(fz_drop_text_page) // NOTE: libk2pdfopt uses old fz_free_text_page symbol |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And this one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That cdecl and the comment are still there but fz_drop_text_page has been renamed to fz_drop_stext_page.
return c == 0x2022 or -- Bullet | ||
c == 0x2023 or -- Triangular bullet | ||
c == 0x25a0 or -- Black square |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there supposed to be an order to these?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know if there is any order here — maybe number of occurances? —, so the three I added has been simply ordered by value.
elseif ncomp == 4 then bbtype = BlitBuffer.TYPE_BBRGB32 | ||
else error("unsupported number of color components") | ||
end | ||
local p = M.fz_pixmap_samples(context(), pixmap) | ||
local bb = BlitBuffer.new(p_width, p_height, bbtype, p):copy() | ||
M.fz_drop_pixmap(context(), pixmap) | ||
M.fz_drop_image(context(), image) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was already done earlier or is it no longer necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's done earlier, as suggested by poire-z, so the error handling is cleaner.
typedef void fz_store_drop_fn(fz_context *, fz_storable *); | ||
struct fz_storable_s { | ||
int refs; | ||
fz_store_drop_fn *drop; | ||
}; | ||
struct fz_key_storable_s { | ||
fz_storable storable; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Four-space indentation, right? :-)
(I know, old file.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's generated code by ffi-cdecl. :)
Simple-out.pdf is used by the unit test to compare the tested and the expected output. I had to update it because the output by MuPDF v1.12 is a bit different. |
Alright, thanks! Please include the base update in koreader/koreader#3547 |
* addMarkupAnnotation expects a float array * Use the latest from koreader-base with koreader/koreader-base#577 Closes #3519.
No description provided.