Age | Commit message (Collapse) | Author |
|
|
|
Sometimes there are populated ones further down our encoding
priority list. E.g non-symbolic encoding (1,0) might be all
zeroes while encoding (0,3) contains data.
|
|
|
|
|
|
|
|
Also keep the PNG files around, but apply zopfli optimization to shrink
those down to 225KB.
Remove text from MuPDF logo in sidebar.
|
|
Use footer_icon to add Discord link.
Remove redundant search field at top. The search field in the sidebar is
enough.
Clean up stylesheet:
Removed sphinx_rtd_docs theme overrides that are not needed with Furo theme.
Removed scroll offset trick that's not needed with Furo theme.
Removed "cta" button styles that are unused.
|
|
|
|
Change TODO comments into actual comments, instead of invalid
substitution definitions.
Add "included" mutool-object-* files to exclusion list, so they aren't
also built as standalone pages with duplicate definitions.
Remove redundant mutool-run-js-api.rst page that was never referenced.
The symbols it defined were duplicated in mupdf-js.rst.
Include missing mutool-object-stroke-state.rst file that existed but
wasn't linked into the documentation.
This fixes most of the Sphinx build warnings.
|
|
Previously we detected the existence of META-INF/container.xml
as being a 100% indication that we had an epub file.
This is bad because HWPX files also have such files, and they
contain content that make us much more sure that they are
HWPX files - and we only score those as 75% to enable
sodochandler to score them higher if it is enabled.
Accordingly, reduce epubs confidence to 74%.
|
|
When subsetting the POST table, we were omitting entries for
glyphs that had to be included because they were used as
composites. For example, in the given file, the ':' glyph
uses the '.' glyph twice. The '.' glyph would otherwise be
removed.
I'm not sure if this actually causes a problem, but it's nicer
to include it.
The second issue, and the one that actually causes the problem
is the regeneration of the cmap table. We were incorrectly
checking the char id against the number of glyphs, rather than
the maximum of the encoding.
We were getting away with this as in most cases the number of
glyphs is still quite large. In this example, however, we were
dealing with a font that had already been subset. So the char
id's were regularly larger than the number of glyphs in our
"original" font.
|
|
According to ISO 32000-1, all unescaped end-of-line markers
within PDF string literals should all be interpreted as a single
0x0a byte.
|
|
Firstly, when skipping blank lines, we were forgetting to
increment the data file. This means that any colour output file
that starts with a black link would just be printed empty. This
fixes input1.pdf.
Secondly, tweak the page margin setup code. I think we'd dropped
a character from this setup at some point. For clarity, split
the different commands to be separate and add comments.
|
|
Without this pressing '<' on an image will try to create a
bookmark on that page, reflow the document and then go back
to the bookmark which will fail.
|
|
|
|
This better describes what it is and matches with the specification.
|
|
|
|
|
|
|
|
Also mention a missing interface to be implemented later.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
When we repair a file, we:
1) Ditch all the objects.
2) Scan through the file lexing for objects and reading them in
3) During this scan if we encounter a second or subsequent version
of an object, we keep that one in preference to any previous one.
4) Once we've scanned the objects, we then run through the xref
looking for ObjStm objects.
5) For every ObjStm object we encounter, we run through it creating
xref entries for each object in the ObjStm.
6) We are at pains to never allow an Object in an ObjStm to override
an object that appears after it in the file. This was originally
done to guard against incremental updates that override an object
in an ObjStm with a normal object, but as this file shows, it
can also help us guard against objects in ObjStms being replaced
with other objects in ObjStms.
7) We then run through the file ensuring that all objects that claim
to be in ObjStms really point to objects that are ObjStms.
As part of the check in step 6) we were looking up the offset for
a given objstm object, and asserting that it was an objstm. This
bug is caused by the assert triggering.
As we process the example file, we first encounter object 2, an
objstm that contains object 5. This is no problem.
We then encounter object 6 that contains both object 2 and object 5.
Processing object '2' changes object '2' from being an objstm
to being an object in an objstm. When we process object 5, we lookup
the existing definition, expecting it to be within an objstm - but
object 2 is no longer such. This causes the assert.
If we had just continued through, we'd have been fine, as stage 7)
would have removed any bad entries at the end.
The fix is to remove the assert, and handle it as a special case.
|
|
|
|
|
|
|
|
Allow for it being off by 1 in more cases (not just in the case where
it's the XRef object that isn't being accounted for).
Maybe we shouldn't repair on broken values at all, and just live with
it?
|
|
point exception.
This happens when computing INT_MIN / -1, that is -2147483648 / -1,
which ought to result in 2147483648. Unfortunately that result is
larger than INT_MAX. Approximate the result by setting it to INT_MAX.
|
|
This was accidentally broken by an earlier commit, that is
f7ac5cbc6a3adfe8d0855ee221d738fe88ab2e4e.
|
|
|
|
|
|
This is supposed to override the intent in the graphics state.
Update fz_image objects to note whether we have an intent, and
if so, what it is.
Update the calls from the PDF interepreter into the rendering
code to use these values. This means that we retain the ability
in the device interface to display an image with a different
intent to that which is specified, as this seems more general.
|
|
Always call svg_begin_state to make a "local" copy of the state that is
safe to mutate. This clones the stroke state.
Then call svg_end_state to clean up (dropping the stroke state clone).
|
|
|
|
|
|
|
|
list nodes.
Previously the stroke state passed to fz_stroke_path() was kept in
the list device, which meant that its values could be changed under
the feet of the list device. Now we always clone the stroke state
before storing it in the list device.
Before commit 5576bba26c0fe38243b25365c6b0faf0638114b5 the stroke
state allocated in svg_state was fz_default_stroke_state which has
refs == -2, so when the fz_append_list_node() called fz_keep_stroke_state()
it had a special case for refs == -2, causing it to be cloned, instead
of kept.
After commit 5576bba26c0fe38243b25365c6b0faf0638114b5, svg_state
did not use the special fz_default_stroke_state, but a normal default
stroke state created by fz_new_stroke_state. This is almost identical
to fz_default_stroke_state, except that refs is == 1 (instead of -2).
This means that when fz_append_list_node() calls fz_keep_stroke_state()
it will NOT clone the stroke state, but instead just increment refs.
The consequence of this that the stroke state left in the list device
is now the same reference as used by the caller. This means that the
called may change stroke state properties without the list device knowing.
Later on when passed the modified stroke state to fz_stroke_path(),
which later ends up in fz_append_list_node(), the pointer to the
modified stroke state is compared to that in the list device.
These pointers are of course the same, so the decision is to not embed
another stroke state into the display list node, even though the stroke
state properties have changed!
The fix is to always make a clone of the stroke state when embedding
it into a display list node. Thereby the list device stroke state
pointer will differ from the one passeed in by the caller through
fz_stroke_state() and therefore a new stroke state will be embedded
into the display list node, similar to how it used to be when the
svg parsed depended on fz_default_stroke_state.
Also add stroke state comparison function for use in display list device.
Previously the display list used pointers to compare two stroke states,
but stroke state pointers are often differen while their contents are
the same, leading display lists containing redundant stroke states.
By comparing the stroke state properties, display list nodes will only
contain stroke states in case their properties have actually changed.
|
|
Now that the stroke state is used by reference the parent's stroke
state will be polluted by the child's modifications. This was not
the case before because the stroke state was copied in its entirety
upon entry to each function, e.g. svg_run_rect(), svg_run_circle(),
etc.
|
|
|
|
|