Age | Commit message (Collapse) | Author |
|
If we hit an out of memory error in fz_draw_end_mask, then pop the
stack, and rethrow. Ensure that the generic device code catches this
error and sets the error_depth to 1 so that the final pop is ignored.
|
|
|
|
|
|
|
|
|
|
|
|
Add a new function pdfapp_autozoom to fit the page to the window by comparing
the aspect ratios of the page and the window to choose whether to fit
horizontally or vertically.
|
|
Various functions (such as fz_begin_group) handle errors internally
by use of the error_depth parameter. This means that if we call
them, we MUST ensure that we call the appropriate closing function.
Similarly, if we don't call them, we should NOT call the closing
function.
In order to ensure we do this correctly, we introduce a cleanup_state
variable that says which ones we tried to call.
This cures the original bug.
|
|
We used to extract the outline using the combined TM*CTM matrix and
use the identity transform for stroking, thus ending up with the wrong
line width.
If we instead extract using the TM and then stroke with the CTM we get
the correct results.
|
|
|
|
Allows compilation with -DFT_DEBUG_LEVEL_TRACE to track down buggy fonts.
|
|
When I changed the stream implementations to use implementation
specific buffers, rather than a generic public one in every fz_stream,
I changed fz_read_byte to only get a single byte at a time.
I noted at the time that the underlying stream was free to decode
larger blocks if it wanted too, but I forgot to actually do this for
the flate decoder. Fixing this here should solve the speed issues.
|
|
Without this, comparefiles/Bug695086 renders the barcode test upside
down.
|
|
Fix broken solution file and add project entries for new files.
|
|
|
|
Grow the edge list using an exponential realloc pattern.
Use qsort for huge paths and only fall back to the simple
shell sort for small paths.
|
|
Fixes bug introduced in commit 1679c1e7a89ae62260fd84ce55c6bef376c6e6ba:
Optimize UniXXX CMap files.
|
|
...without adding it to the standard list of required third party
dependencies.
|
|
|
|
This adds a custom memory management layer between libjpeg and the calling
app - in such a way that the code can be shared between mupdf and
Ghostscript/PDL.
|
|
Don't let a glyph's bbox be too much bigger than the font bbox.
|
|
See bug 693314 (file Z23-04.pdf) for an example file.
|
|
key length.
This reverts commit b1ed116091b790223a976eca2381da2875341e10.
The key length for V==2 must be 40 <= length <= 128.
The key length for V==4 is not taken from the /Length entry.
|
|
|
|
|
|
|
|
Same as for fz_bbox_fill_image_mask, fz_bbox_clip_image_mask must
transform the unit rectangle to get the bounding bbox.
|
|
There are two issues where variables may be used unitialized:
* extract_exif_resolution fails to set xres and yres for JPEG images if
there's no valid resolution unit (mainly affects XPS documents)
* xps_measure_font_glyph uses hadv and vadv unitialized if the glyph id
isn't valid (i.e. if FT_Get_Advance fails)
|
|
Convert from UTF-8 to UCS-2 to display unicode text properly.
|
|
One to write a CMap out in expanded form ready for text processing tools.
Another to write a CMap out as compactly as possible.
The output is not in proper CMap format and can only be parsed by MuPDF.
|
|
Split common parts into separate CMap files and include them with usecmap.
This reduces the size of the compiled in CMap resources from 3Mb to 2Mb.
|
|
Thanks to Triet Lai.
|
|
Increasing the existing data structure to 32-bit values would bloat the data
tables too much.
Simplify the data structure and use three separate range tables for lookups --
one with small 16-bit to 16-bit range lookups, one with 32-bit range lookups,
and a final one for one-to-many lookups.
This loses the range-to-table optimization we had before, but even with the
extra ranges this necessitates, the total size of the compiled binary CMap data
is smaller than if we were to extend the previous scheme to 32 bits.
|
|
Remove obsolete Adobe-Japan-2 based CMaps.
|
|
|
|
These files are maintained by debian. Now that debian updates the mupdf package
more regularly there is no need for us to keep our own debian packaging files.
https://packages.debian.org/unstable/main/mupdf
|
|
pdf_write_document still writes the entire xref with references to all
freed objects even if the xref has been compacted which makes the
result of mutool clean -ggg larger than necessary.
|
|
|
|
Currently, png_read_phys always rounds the resolution down. Many images
have a resolution just slightly shy of 96 DPI and are thus rendered too
large when they're resized from 95 to match the required 96 for output.
|
|
If the reported height is 0 or too large, use the image size reported
in the PDF itself instead (in the case of height 0, the JPEG library
is supposed to read the correct value from the DNL segment, but libjpeg
doesn't support that).
|
|
|
|
SC_MAXIMIZE is only sent when maximizing via the maximize button.
Dragging to the screen edge, double clicking the title bar or
WinKey+Up do not generate an SC_MAXIMIZE message.
Detect when gettincg a WM_SIZE message with SIZE_MAXIMIZE instead.
|
|
If a JPEG stream is missing valid values for width/height (usually -1),
Adobe Reader substitutes these using the values read from the PDF
object. This can be done by scanning and patching the data before
passing it to libjpeg.
Thanks to zeniko for the patch.
|
|
Use an explicit list of resolutions for +/- zoom stepping.
|
|
|
|
fast_cmyk_to_rgb had a simple 1 place cache to avoid recalculating
the same conversions again and again. The implementation was broken
though, both in C and ARM code versions. This seems to fix it.
|
|
... instead convert a JPEG2000 used as a soft mask into grayscale.
This is more robust than trusting the PDF specified colorspace over
the internal JPX colorspace.
The spec implies that in a colorspace conflict, the internal JPX
colorspace should be used.
The PDF colorspace may be a DeviceN or Separation colorspace.
DeviceN and Separation colorspaces are not valid destination
colorspaces, so we may not always be able to convert the internal
JPX colorspace into the PDF specified colorspace.
Converting from the internal colorspace into grayscale is more robust,
and solves the issue that the original commit was intended to fix.
|
|
|
|
Stupid unportable code needs stupid unportable preprocessor macros.
This only works with GCC, but should be good enough since I expect
anyone using a big-endian machine to also use a GCC compatible compiler.
|
|
|