Julian Smith [Mon, 28 Oct 2024 17:39:55 +0000 (17:39 +0000)]
scripts/wrap/cpp.py: added include of <algorithm>.
Required for use of std::min in some custom methods.
Julian Smith [Mon, 7 Oct 2024 18:52:25 +0000 (19:52 +0100)]
scripts/wrap/swig.py: fix occasional windows build problem with Py_LIMITED_API.
On some windows machines, the generated C++ code's calls to malloc() and free()
can cause a compilation failure.
Julian Smith [Fri, 18 Oct 2024 10:00:11 +0000 (11:00 +0100)]
scripts/wrap/: added fz_enumerate_font_cmap2() C++ wrapper.
Returns std::vector of (ucs,gid) pairs.
Julian Smith [Fri, 15 Nov 2024 15:19:31 +0000 (15:19 +0000)]
scripts/wrap/: Allow fix of broken auto-dependencies in PyMuPDF builds.
PyMuPDF builds use build directories containing `Py_LIMITED_API=*` which
results in auto-dependency files containing things like:
build/PyMuPDF-amd64-shared-tesseract-Py_LIMITED_API=0x030a0000-release/source/fitz/context.o: foo.h
Unfortunately the `=` breaks thngs because it causes make to treat this
as setting variable `build/PyMuPDF-amd64-shared-tesseract-Py_LIMITED_API`
to `0x030a0000-release/source/fitz/context.o: foo.h`, not as a `<target>:
<prerequisites>` rule.
PyMuPDF will be changed to use build directories without the `=` such as
build/PyMuPDF-amd64-shared-tesseract-Py_LIMITED_API_0x030a0000-release/, which
we now accept.
Robin Watts [Wed, 16 Oct 2024 17:36:48 +0000 (18:36 +0100)]
Add fz_enumerate_font_cmap.
Robin Watts [Thu, 31 Oct 2024 17:57:34 +0000 (17:57 +0000)]
Bug 707989: Fix breaking numbering of HTML lists.
We number lists by using a list counter as we step through
the boxes. The idea is that when we step into another layer of
list, we should store the current value, reset it to 0,
process the next layer, and then restore the saved number.
At the moment, we are only doing this store/restore when stepping into
ordered lists. We need to do this for all different list types.
Tor Andersson [Mon, 28 Oct 2024 14:43:38 +0000 (15:43 +0100)]
Fix reference counting error in pdf_redact_image_filter_pixels
Fixes the issue in:
https://github.com/pymupdf/PyMuPDF/issues/3758
Robin Watts [Thu, 31 Oct 2024 17:37:04 +0000 (17:37 +0000)]
Bug 707840: When SMask changes, clear the SMask TR.
Previously we were only changing it when the SMask gave a new
TR.
Julian Smith [Fri, 15 Nov 2024 21:25:14 +0000 (21:25 +0000)]
include/mupdf/fitz/version.h: update to 1.24.11.
Sebastian Rasmussen [Fri, 27 Sep 2024 01:23:27 +0000 (03:23 +0200)]
Bug 708032: When redacting pages, create new content stream objects, do not replace them.
In the file from the bug both page 5 and page 7 refer to the same
contents stream object, 32 0 R.
So when page 5 is redacted its resources will be renamed and its
contents stream will updated conversely. But this also replaces the
contens stream for page 7, but its resources will not be renamed.
Later on when page 7 is redacted, its already updated contents stream
now refers to resources that exist by their original names in its
resource dictionary.
If the page's contents consisted of an array of streams or if the
stream object was entirely missing a new contents stream object would
be created, otherwise the contents stream object was updated in place.
By updating the contens stream object in place one page's contents
would also change another page's contents.
The fix therefore to always create a new stream object for the
new contents stream of the redacted page.
Tor Andersson [Fri, 9 Aug 2024 11:11:55 +0000 (13:11 +0200)]
Bug 707845: Prioritize SMask over Mask entry.
In case both are set, we should ignore the Mask entry.
Julian Smith [Fri, 27 Sep 2024 23:23:29 +0000 (00:23 +0100)]
scripts/wrap/swig.py: avoid creating invalid global Python PdfObj whose destructor crashes.
A PdfObj object created from PDF_LIMIT is invalid and will crash pdf_drop_obj()
because values >= PDF_LIMIT are considered to be pointers.
Julian Smith [Fri, 27 Sep 2024 13:11:26 +0000 (14:11 +0100)]
scripts/wrap/: allow separate control over enabling ref-counting and trace code.
Generation of code for trace diagnostics (enabled at runtime with, for example
MUPDF_trace=1) is now controlled with new `-b` option `--trace-if <trace_if>`,
instead of the existing `--refcheck-if` option.
This allows enabling of tracing code without incurring overhead of refcount
checking.
Julian Smith [Fri, 28 Jun 2024 15:13:07 +0000 (16:13 +0100)]
scripts/wrap/ docs/: added operator bool() to non-pod wrapper classes.
This avoids problems with Python code doing things like `if page: ...`. This
previously always evaluated as true, but now evaluates as true only if the
underlying `page.m_internal` pointer is not null.
Trace diagnostics for operator bool() are generated in debug builds if
MUPDF_trace=1.
Julian Smith [Wed, 25 Sep 2024 10:53:32 +0000 (11:53 +0100)]
scripts/: avoid encoding exception with --test-csharp on some Windows machines.
scripts/
jlib.py:system()
Swallow exceptions when writing to a stream.
mupdfwrap_test.cs
scripts/wrap/__main__.py
Added brief comments to explain use of unicode character in filename.
Julian Smith [Tue, 17 Sep 2024 16:53:15 +0000 (17:53 +0100)]
scripts/wrap/swig.py: add missing PDF_TRUE etc to Python API.
These macros were not included in Python API because they are not ints so were
ignored by SWIG.
PDF_NULL
PDF_TRUE
PDF_FALSE
PDF_LIMIT
Also improved file-change detection when running swig.
Julian Smith [Thu, 22 Aug 2024 09:40:10 +0000 (10:40 +0100)]
Added support for Python bindings that work with all Python versions.
This uses Py_LIMITED_API.
Also involves a small change to name of SWIG-generated .cpp file,
so docs have also been updated with the new name. Also removed some
docs from scripts/wrap/__main__.py that duplicated information in
docs/src/language-bindings.rst.
Changed Windows builds of the Python and C# bindings to use direct invocation
of cl.exe and link.exe instead of using devenv to run .vcxproj files, so that
we can more easily control compiler/linker flags.
Julian Smith [Mon, 8 Jul 2024 14:48:27 +0000 (15:48 +0100)]
scripts/wrap/: avoid unnecessary rebuilds on Windows.
Extra carriage return characters can appear in generated code strings, but
disappear when saved to file, which was causing us to do spurious rebuilds.
Julian Smith [Tue, 4 Jun 2024 12:22:51 +0000 (13:22 +0100)]
docs/: added graphviz diagram to language bindings.
docs/src/conf.py:
Specify extra extension sphinx.ext.graphviz.
docs/src/language-bindings.rst:
Added graphviz diagram to show relation between C, C++, Python and C# APIs.
Fixed a few layout issues.
Improved description of generated files.
Julian Smith [Sun, 7 Jul 2024 20:17:25 +0000 (21:17 +0100)]
scripts/: allow use of experimental python-3.13 on Github.
scripts/wdev.py:
WindowsVS:
Minor change to put code inside try..catch in order to give slightly
better diagnostics if we fail to find VS.
Also find MSBuild.exe.
WindowsPython:
When looking for Python locations, also consider currently-running
Python using code previously in scripts/wrap/__main__.py. This enables
us to work with experimental python-3.13 on Github, where python-3.13
is not available via `py`.
scripts/wrap/__main__.py:
Use only wdev for finding python paths etc.
scripts/pipcl.py:
Use recently-modified wdev PythonFlags.
Some minor fixups to spelling etc.
Julian Smith [Fri, 7 Jun 2024 17:13:12 +0000 (18:13 +0100)]
scripts/pipcl.py: move version checking code into separate fn.
Sebastian Rasmussen [Wed, 2 Oct 2024 16:15:29 +0000 (18:15 +0200)]
Bump patch release.
Tor Andersson [Fri, 30 Aug 2024 10:40:29 +0000 (12:40 +0200)]
Increase layer/clip nesting depth limit.
To allow processing test file sumatrapdf/draw_stack_overflow.pdf without
errors.
Sebastian Rasmussen [Tue, 16 Jul 2024 23:08:27 +0000 (01:08 +0200)]
Check nesting depth before pushing clip mark.
Without this the nesting depth might step outside the layer/clip stack.
Robin Watts [Thu, 1 Aug 2024 15:18:47 +0000 (16:18 +0100)]
Bug 707925: Avoid SEGV on partially filled default colorspaces.
Robin Watts [Fri, 19 Jul 2024 16:41:22 +0000 (17:41 +0100)]
Bug 707890: Carry over structparent information when cleaning.
We were completely omitting the structure tree when copying.
This meant that information like "ActualText" was missing,
resulting in problems when doing text extraction.
Here we copy the entirety of the Structure Tree across, and
regenerate the ParentTree so that the Page StructParents still
point to the right thing.
We do NOT cut the actual Structure Tree down, so the file remains
larger than it maybe needs to be - but it is at least correct now.
Robin Watts [Mon, 22 Jul 2024 16:05:59 +0000 (17:05 +0100)]
Bug707859: Tweak text extraction
We were already allowing for a slight overlap in characters
when extracting, but the test file in this bug has chars
squeezed together slightly more than we were expecting.
Consider the following: (Diagram exploded vertically for
clarity - in the test file the chars are on the same line).
+--------+
| |
| |
+--------+
+--------+
| |
| |
+--------+
|<-s-|
's' in the diagram is 'spacing' in the code.
The existing code copes with s being negative, if its absolute
size is smaller than SPACE_DIST (0.15). In this case s is around
-3.5 which absolute is comfortably less than SPACE_MAX_DIST (0.8).
Such cases were falling into the 'just consider it as a new line'
case.
Robin Watts [Fri, 12 Jul 2024 17:04:54 +0000 (18:04 +0100)]
Bug 707843: Fix display list handling of structure and metatext.
The nesting of structure and metatext is not neat w.r.t clipping
etc. To avoid failing to send structure and metatext in such cases
(or to send a start without an end etc), just ignore clipping for
these.
Robin Watts [Thu, 13 Jun 2024 18:23:03 +0000 (19:23 +0100)]
Bug 707826: Fix SVG clip path mistake.
SVG clipPaths use clip-rule, not fill-rule. This was causing even-odd
clipping regions to be drawn as non-zero.
Tor Andersson [Wed, 3 Jul 2024 17:16:44 +0000 (19:16 +0200)]
Bug 707824: Emit properly nested clip and layer operations in PDF.
If BMC/EMC and q/Q pairs (that apply clipping) don't nest properly, warn
and close the EMC either immediately (if badly nested one way) or at the
next Q (if badly nested the other way).
Example 1:
q
BMC
Q (close layer before this Q)
EMC (ignore this EMC)
Example 2:
BMC
q
EMC (ignore this EMC)
Q (close layer after this Q)
Also change SVG output to emit Inkscape specific layer attributes.
---
mc_depth tracks the level of BMC/EMC nesting in the content stream.
nest_mark tracks the level of layer and clip calls that we've made to the fz_device.
If the q/Q and BMC/EMC are badly nested, we ignore some EMCs and save them
until we hit the next Q. The check in do_end_layer only ends the layer if the
device and content stream are "in sync".
If we're not in sync, we ignore the EMC. This can happen in two cases: either
we saw a Q too early, or we saw an EMC too early.
In the first case we have already popped the layer (so the EMC should be
completely ignored).
In the second case the layer started before the clip and we cannot end the
layer just yet (so ignore the EMC until we see the Q and then pdf_grestore puts
the world back into order).
The loops around the pop_clip in pdf_grestore recover the syncing. The loop
before closes any layers that need to be ended before the clip is popped (layer
started with BMC inside the clip, but ends after the clip). The loop after
closes any layers that had the EMC inside the clip but were started with BMC
before the clip mask was pushed.
Robin Watts [Thu, 20 Jun 2024 14:01:13 +0000 (15:01 +0100)]
Bug 707777: Speedup transfer function application.
Use memoisation to speed the application of transfer functions
to softmasks.
Robin Watts [Tue, 16 Jul 2024 13:27:46 +0000 (14:27 +0100)]
Bug 707882: Rejig fz_shade storage of functions.
Previously we would sample the functions and store the values in
a float * 256 * (FZ_MAX_COLORS+1) sized table. This meant that
shadings were ~34k each.
Here, we change to storing the values in a float * 256 * stride
table (where stride is only as big as required - typically 4 or 5).
This saves a lot of memory.
Sebastian Rasmussen [Wed, 24 Jul 2024 13:42:18 +0000 (15:42 +0200)]
Bump patch release.
Sebastian Rasmussen [Wed, 24 Jul 2024 10:27:02 +0000 (12:27 +0200)]
jni: Fix compilation errors during java build.
This was never caught in the review of commit
113055096abdbde1996669061f64b6463421970e
Sebastian Rasmussen [Wed, 24 Jul 2024 10:26:08 +0000 (12:26 +0200)]
jni: Introduce helper function to wrap pdf_document.
Julian Smith [Fri, 19 Jul 2024 01:40:51 +0000 (02:40 +0100)]
scripts/wrap/swig.py: fix c# bindings treatment of int64 on Linux.
We run swig with -DSWIGWORDSIZE64. This ensures that C long types such as
uint64_t are mapped to C# long (was previously C# int).
Robin Watts [Fri, 19 Jul 2024 08:49:08 +0000 (09:49 +0100)]
Rename fz_document_as_pdf to fz_new_pdf_document_from_fz_document.
Better name. Use of the 'new' allows the SWIG rewriting to
spot that it returns a new reference.
Tor Andersson [Thu, 18 Jul 2024 16:08:51 +0000 (18:08 +0200)]
Don't typecast between function pointers with different signatures.
It may be safe in some contexts, but...
1) Explicit type casts hide errors.
2) In WASM it will crash when function signatures are incompatible.
Julian Smith [Wed, 17 Jul 2024 21:37:00 +0000 (22:37 +0100)]
scripts/wrap/cpp.py: fix recent breakage of C++ API build.
We update fz_document_handler_open() to match recent changes.
Robin Watts [Thu, 11 Jul 2024 15:46:00 +0000 (16:46 +0100)]
Update document handler recogniser/opener interface.
Allow the recogniser to pass back state that can be reused in
the opener.
Robin Watts [Thu, 11 Jul 2024 16:46:29 +0000 (17:46 +0100)]
Revised version of pdf_specifics commit.
Put pdf_specifics/pdf_document_from_fz_document back to how it
was before. This is because both the Java and the JS bindings
decide very early on in the lifecycle of a document whether they
should create a Document or a PDFDocument.
This is no good for documents that might take a while for the PDF
version to become available (say, because they are waiting for
a password to be presented).
Instead, we add a new fz_document_as_pdf function that will
return a (non-borrowed) reference to a pdf_document derived from
the original. If the original is a PDF, then it'll just return
the same document. If it's a document that has an underlying
PDF representation it'll return a (different) pointer to that.
Otherwise it will return NULL.
Robin Watts [Thu, 11 Jul 2024 10:45:53 +0000 (11:45 +0100)]
Change mechanism used for pdf_document_from_fz_document.
(And pdf_specifics, which is the old name for the same thing).
Rather than comparing a function pointer, implement this using
a function. This means that so_doc_handler can implement this
too, so people can get a pdf_document handle to the converted
file.
Robin Watts [Tue, 9 Jul 2024 18:18:41 +0000 (19:18 +0100)]
Tweak office_recognise_doc_content.
Only ever return 75 rather than 100. This allows other "better"
handlers to override us.
Robin Watts [Tue, 2 Jul 2024 15:02:49 +0000 (16:02 +0100)]
Add convenience Makefile target.
Julian Smith [Fri, 14 Jun 2024 21:05:10 +0000 (22:05 +0100)]
scripts/wrap/: make use of jlib.system()'s support for multiline commands.
Also fix --test-cpp, need to build with -DNDEBUG.
Julian Smith [Fri, 14 Jun 2024 20:55:41 +0000 (21:55 +0100)]
scripts/jlib.py: system(): added support for multiline commands.
Robin Watts [Wed, 19 Jun 2024 17:33:23 +0000 (18:33 +0100)]
Fix VS projects for when thirdparty/so is not present.
My previous tests had leftovers in the build dirs, and so were
passing when clean clones were not.
Julian Smith [Fri, 14 Jun 2024 10:59:42 +0000 (11:59 +0100)]
scripts/wrap/__main__.py: fix bug in c# windows debug builds.
Julian Smith [Sat, 15 Jun 2024 07:38:06 +0000 (08:38 +0100)]
scripts/wrap/cpp.py docs/: reintroduce extra fns to call fz_document_handler fnptrs.
These are required by pymupdf.
Julian Smith [Fri, 14 Jun 2024 15:43:46 +0000 (16:43 +0100)]
scripts/wrap/cpp.py docs/src/language-bindings.rst: fixed build failure after recent changes.
Removed extra C++ fns for calling fnptrs fz_document_open_fn and
fz_document_recognize_content_fn.
These were broken by recent changes to the fnptr args, and they are no longer
used by PyMuPDF, so better to delete them rather than fix them.
Also updated docs/src/language-bindings.rst's list of extra fns to match.
Robin Watts [Fri, 14 Jun 2024 15:11:38 +0000 (16:11 +0100)]
Fix wchar_from_utf8 to cope with surrogate pairs.
It would be nice to use fz_wchar_from_utf8 instead of this,
but we don't have an fz_context available in the circumstances
where this is called. So live with the code duplication.
Robin Watts [Wed, 5 Jun 2024 09:51:35 +0000 (10:51 +0100)]
Add project file handling for sodochandler
This is a closed-source library that can downloaded (if
you've licensed it) to thirdparty/so, whereupon the
ReleaseCommercial/DebugCommercial/MementoCommercial
configurations will work.
This uses a document handler that uses SmartOffice's
PDF export mechanism to allow Office based docs to be
loaded and processed as normal MuPDF documents.
Robin Watts [Wed, 5 Jun 2024 14:36:37 +0000 (15:36 +0100)]
Modify document handler to facilitate state in the handler.
Tweak the document handler so that a handler provider can
sensibly maintain state.
Add a new 'fin' method for when MuPDF unloads so that a
handler provider can clean up.
Robin Watts [Fri, 14 Jun 2024 08:54:59 +0000 (09:54 +0100)]
Tweak fz_new_output_to_tempfile.
It seems likely that L_tmpnam will always be larger than
sizeof("/tmp/fztmpXXXXXX") but just in case it isn't, use
separate bounds for namebuf in the windows/linux cases.
This also lets us avoid using strcpy to shut up stupid
compilers.
Robin Watts [Wed, 5 Jun 2024 16:43:32 +0000 (17:43 +0100)]
Add 'wants_file' to fz_document_handler structure.
If this is set, then the document handler requires an actual
file, rather than just a stream. We handle this by passing
an fz_stream in, which the document_handler can retrieve the
filename of using fz_stream_filename.
In the case where a document handler 'wants_file', but the
stream can't provide a filename, the system will create a
tempfile with the stream contents in, and pass a stream that
points to that.
Care is taken to avoid, as far as possible, making this
temporary file more than once.
Robin Watts [Wed, 12 Jun 2024 11:13:08 +0000 (12:13 +0100)]
Add fz_write_stream function.
Copy a stream to an output.
Robin Watts [Wed, 12 Jun 2024 15:03:22 +0000 (16:03 +0100)]
Bug 707775: Ensure fz_is_directory() works with utf-8 on windows.
To do this, we've implemented fz_wchar_from_utf8 to mirror
fz_utf8_from_wchar.
Robin Watts [Wed, 5 Jun 2024 14:32:52 +0000 (15:32 +0100)]
Add fz_stream_filename and fz_open_file_autodelete.
fz_stream_filename, gets a filename from a stream if possible.
Might return NULL, such as when the stream does not come from a file.
fz_open_file_autodelete, opens a file that will be deleted
as when the stream is dropped. If we fail to open, it will be
deleted too!
Tor Andersson [Tue, 14 May 2024 13:19:53 +0000 (15:19 +0200)]
Open directory archive at document root for plain HTML handler.
To allow relative paths to image resources, etc.
Tor Andersson [Thu, 18 Jul 2024 16:19:29 +0000 (18:19 +0200)]
Bump patch release.
Robin Watts [Fri, 19 Jul 2024 11:06:05 +0000 (12:06 +0100)]
Fix function returning a void value.
Tor Andersson [Fri, 19 Jul 2024 08:35:53 +0000 (10:35 +0200)]
Fix pdf_page_from_fz_page
Tor Andersson [Thu, 18 Jul 2024 16:08:51 +0000 (18:08 +0200)]
Don't typecast between function pointers with different signatures.
It may be safe in some contexts, but...
1) Explicit type casts hide errors.
2) In WASM it will crash when function signatures are incompatible.
Tor Andersson [Thu, 18 Jul 2024 16:19:29 +0000 (18:19 +0200)]
Bump patch release.
Robin Watts [Tue, 9 Jul 2024 14:06:51 +0000 (15:06 +0100)]
Fix ifdeffery in platform/java/Android.mk
Spotted when trying to update the version of MuPDF used within
SmartOffice builds.
Credit to Mary Clayton.
Robin Watts [Wed, 12 Jun 2024 18:16:36 +0000 (19:16 +0100)]
Bug 707771: Fix redaction problems.
The issue here is that the 'remove pixels from images' code is
triggering removals when it should not.
Tests indicate that this is going wrong because fz_is_quad_inside_quad()
is telling us that the image is completely covered.
The cases where this is going wrong are when one of the quads is
actually a singleton point. Examination of the code shows that
this is a case we don't cope with in fz_is_point_inside_triangle.
A triangle with all 3 points identical will claim to include any
point at all. Or, I think, any triangle with points colinear.
I don't understand the maths in the old algorithm well enough to
fix it, so I swap to different algorithm that I do understand.
The old algorithm is apparently derived from:
https://fgiesen.wordpress.com/2013/02/06/the-barycentric-conspirac/
and the new one is from:
https://planetcalc.com/8108/
Robin Watts [Wed, 12 Jun 2024 17:50:59 +0000 (18:50 +0100)]
Bug 707771: Fix PDF filter operator losing content.
The W and W* operators were using 'gstate->pending.ctm' as the
transform, when they should have been using the concatenation
of that and 'gstate->sent.ctm'. Accordingly, we were incorrectly
thinking that we were clipping stuff away to nothing.
This looks to be the only place we made this mistake.
Sebastian Rasmussen [Thu, 27 Jun 2024 21:58:52 +0000 (23:58 +0200)]
Bump patch release.
Julian Smith [Tue, 25 Jun 2024 09:42:23 +0000 (10:42 +0100)]
scripts/wrap/state.py: fix pyodide builds.
Pyodide builds have started to fail recently because `pdf_parse_ind_obj()`'s
`int64_t*` out-param is now treated as incompatible with a `long*`.
The fix here is to change our `get_name_canonical()` to preserve typedef
`int64_t` similarly to `size_t` and not convert to the underlying `long` or
`long long` type. This appears to work fine with SWIG, which sometimes has
problems with typedefs.
Julian Smith [Thu, 6 Jun 2024 15:34:42 +0000 (16:34 +0100)]
scripts/: convert C# strings to utf8 on Windows.
By default SWIG on Windows does not convert C#'s native utf16 strings to utf8, but MuPDF
expects utf8.
We use some custom SWIG typemaps to do the conversion, originating from a
currently un-merged SWIG PR for std::string, with extra code to handle const
char*.
Added test to scripts/mupdfwrap_test.cs that we can open a file with a
character that requires 4-bytes in utf16.
Sebastian Rasmussen [Mon, 24 Jun 2024 15:51:38 +0000 (17:51 +0200)]
Bump patch release.
Sebastian Rasmussen [Fri, 21 Jun 2024 01:25:22 +0000 (03:25 +0200)]
Add icon and feature graphic used at Google Play Store.
Tor Andersson [Mon, 17 Jun 2024 10:52:05 +0000 (12:52 +0200)]
New logo! Updates existing logo files, removes unreferenced files.
Add mupdf icon images at various sizes.
Update X11 and GL app icon for windows.
Optimized other PNG files in the repository.
Add Android VectorDrawable version of logo.
Add monochrome version of icon.
Tor Andersson [Thu, 20 Jun 2024 11:07:28 +0000 (13:07 +0200)]
Bug 707829: Use a big (bogus) codespace range for remapped CMaps.
Don't use the original codespace ranges, because they won't be correct
after inverting. Since we don't use the codespace ranges for these
remapped CMaps, we don't need them to be accurate, just large enough to
not trigger errors when adding the inverted ranges to the Cmap.
Note: codespace ranges are only used to decode the multi-byte strings
in content streams as arguments to the show operator TJ &co.
Julian Smith [Fri, 7 Jun 2024 12:50:21 +0000 (13:50 +0100)]
source/html/html-layout.c: fix SEGV with empty <hN> header block.
Sebastian Rasmussen [Sat, 15 Jun 2024 13:33:16 +0000 (15:33 +0200)]
java: Add static function to check for external Link uris.
Sebastian Rasmussen [Tue, 18 Jun 2024 11:20:48 +0000 (13:20 +0200)]
java: Fix triangle test similar to fix already at C level.
Commit
dcb048aa62d7499b572f90e708ad2540bd3d2c56 omitted the
implementation for java.
Sebastian Rasmussen [Mon, 10 Jun 2024 22:25:58 +0000 (00:25 +0200)]
Zoom level 0 is the same as a missing value when creating destinations.
The spec mentions this:
A null value for any of the parameters left, top, or zoom specifies
that the current value of that parameter shall be retained unchanged.
A zoom value of 0 has the same meaning as a null value.
Robin Watts [Tue, 11 Jun 2024 08:15:49 +0000 (09:15 +0100)]
Bug 707822: Take missing coordinates into account when creating link dest.
Previously if either coordinate was NaN, then after transformation
both coordinates would be NaN. But it is desired for given coordinates
to be transformed while missing coordinates are kept at NaN.
From an original patch by Sebastian.
Sebastian Rasmussen [Tue, 11 Jun 2024 21:00:45 +0000 (23:00 +0200)]
Bump patch release.
Sebastian Rasmussen [Tue, 4 Jun 2024 10:26:32 +0000 (12:26 +0200)]
docs: Update thirdparty library versions.
Sebastian Rasmussen [Tue, 28 May 2024 21:59:05 +0000 (23:59 +0200)]
Make it possible to override USE_SYSTEM_CURL in user.make.
Sebastian Rasmussen [Wed, 5 Jun 2024 00:25:36 +0000 (02:25 +0200)]
Support stream lengths >= 2GByte by consistently using int64_t.
Without this a saved PDF file may e.g. get stream lengths that are
negative.
Sebastian Rasmussen [Tue, 4 Jun 2024 23:44:16 +0000 (01:44 +0200)]
Improve null and bounds checks for gid renumbering array in font subsetting.
Without this a creatively created file can provoke ASAN complaints
when the array is accessed outside its bounds.
Sebastian Rasmussen [Tue, 4 Jun 2024 22:57:41 +0000 (00:57 +0200)]
Check if pushed gstate is the first state in font analysis.
Without this fix if the PDF contains too many Q operators followed by
a q operator in a content stream this will provoke ASAN complaints
about reading null pointers.
Sebastian Rasmussen [Fri, 31 May 2024 10:33:30 +0000 (12:33 +0200)]
Handle NULL format when creating document writer.
Coverity complains that if the format is NULL when passed to
fz_new_document_writer() the pointer will be dereferenced in
is_extension() potentially causing a crash. The fix is to add
a NULL-check in is_extension() causing fz_new_document_writer()
to eventually throw an exception.
This fixes Coverity issue 362814.
Sebastian Rasmussen [Mon, 3 Jun 2024 15:10:46 +0000 (17:10 +0200)]
Bug 707808: Throw exception upon invalid glyf table indicies in font subsetting.
Sebastian Rasmussen [Mon, 3 Jun 2024 14:38:36 +0000 (16:38 +0200)]
Bug 707808: Avoid NULL pointer deref upon no horizontal metrics in font subsetting.
Sebastian Rasmussen [Mon, 3 Jun 2024 14:18:08 +0000 (16:18 +0200)]
Bug 707808: Plug memory leak upon exception in subset_post2().
Sebastian Rasmussen [Mon, 3 Jun 2024 14:13:42 +0000 (16:13 +0200)]
Bug 707808: Move length check prior to first time name is used in font subsetting.
Sebastian Rasmussen [Mon, 3 Jun 2024 11:35:32 +0000 (13:35 +0200)]
Bug 707808: Plug memory leak upon exception in font subsetting.
Sebastian Rasmussen [Mon, 3 Jun 2024 11:34:02 +0000 (13:34 +0200)]
Bug 707808: Avoid dereferencing a zero length buffer while subsetting fonts.
Sebastian Rasmussen [Mon, 3 Jun 2024 11:06:41 +0000 (13:06 +0200)]
Bug 707808: Check limit of index before using it in font subsetting.
Without this certain files may cause ASAN complaints. Also the check
is off by one, so now warn if the index is the same as the count.
Sebastian Rasmussen [Fri, 31 May 2024 12:39:08 +0000 (14:39 +0200)]
Bug 707808: Check length of name table entries in font subsetting.
Sebastian Rasmussen [Mon, 3 Jun 2024 00:19:09 +0000 (02:19 +0200)]
Bug 707808: Ensure that string table offsets are large enough.
Previously in edge cases the offsets could overflow, but now ensure
that the offsets are large enough.
Sebastian Rasmussen [Sat, 1 Jun 2024 12:43:18 +0000 (14:43 +0200)]
Bug 707808: Avoid shadowing outer varible in font subsetting.
Sebastian Rasmussen [Fri, 31 May 2024 12:00:00 +0000 (14:00 +0200)]
Bug 707808: Do not step outside buffer when subsetting font.
Julian Smith [Tue, 4 Jun 2024 15:34:41 +0000 (16:34 +0100)]
scripts/wrap/: fix handling of new enum/fn pdf_zugferd_profile.
If an enum and fn have same name, we need to not SWIG %ignore the name, so do
this with `pdf_zugferd_profile` like we already do with `pdf_annot_type`. [We
usually %ignore all raw C fn names because we only want SWIG to see the C++
wrapper fns.]
Also fixed generated C# out-param code when handling MuPDF enums.
Julian Smith [Mon, 27 May 2024 18:00:51 +0000 (19:00 +0100)]
scripts/wrap/__main__.py: support bsymbolic.
If build directory contains `-bsymbolic` we set XLIB_LDFLAGS to
`-Wl,-Bsymbolic`.
Julian Smith [Mon, 27 May 2024 17:59:32 +0000 (18:59 +0100)]
Makefile: add XLDFLAGS, XLIB_LDFLAGS and XEXE_LDFLAGS to link commands.