summaryrefslogtreecommitdiff
path: root/source
AgeCommit message (Collapse)Author
2018-10-18Bug 699971. Fix bad read of mask type from display list.Robin Watts
We pack the mask type and the color parameters into a byte. We were unpacking it incorrectly, resulting in all masks being treated as luminosity ones.
2018-10-18Bug 699967: Follow ons.Robin Watts
1) Reset the margins at the start of each PCL job to avoid offsetting the page contents. 2) Fix height/band_height confusion in mono band writing.
2018-10-18Bug 699967: Fix crash with wide format output to color PCL.Robin Watts
Writing to wide format output was causing uncompressed lines of more than 32K to be written to a 32K buffer. I now recognise that there is an inherent limitation in PCL where image data can't be larger than 32K, so we'll have to split page output into subimages and hope they register well enough. This new commit does that (and solves the overwrite). I am seeing problems when feeding the output from this into gpcl due to the delta compression. We believe this is a bug in gpcl, and is being investigated as bug 699969.
2018-10-16Fix line spacing bug in rewriting PDF files.Robin Watts
The filter op for Tz was reading the scale in and dividing by 100 as we do elsewhere. The buffer op was then forgetting to multiply by 100 before rewriting it.
2018-10-15Update lcms2 to lcms2mt.Robin Watts
Pull in the latest changes from mainline lcms2, and bugfixes from gs. This should now be the definitive version.
2018-10-12Corrected stream reference counting.Sebastian Rasmussen
2018-10-12Drop separation pixmap upon exception.Sebastian Rasmussen
2018-10-12Drop xref subsection upon exception.Sebastian Rasmussen
2018-10-12Set separation reference count early.Sebastian Rasmussen
This makes it easier to test failure inside the succeeding fz_try().
2018-10-12Drop CMAP upon exception.Sebastian Rasmussen
2018-10-12Drop display list upon exception.Sebastian Rasmussen
2018-10-12Drop default colorspaces upon exception.Sebastian Rasmussen
2018-10-12Drop resources in mudraw upon exception.Sebastian Rasmussen
2018-10-12Drop default colorspaces upon exception.Sebastian Rasmussen
2018-10-12Revert to no CMM if the new CMM engine fails midway.Sebastian Rasmussen
The exception is still thrown, however. This just ensures that CMM is not left in an unknown state.
2018-10-12Keep cmm instance around until all colorspaces have been dropped.Sebastian Rasmussen
By setting ctx->cmm_instance == NULL we actively made sure that fz_cmm_fin_profile() would never call ->fin_profile() to actually clean up the ICC profiles. This could be triggered by doing mutool draw -N even without a file name, triggering a memory leak.
2018-10-12Rethrow exception when unable to create new ICC colorspace.Sebastian Rasmussen
2018-09-21Add fz_lookup_cjk_font_by_name to create builtin CJK fonts.Tor Andersson
2018-09-21Regularize language and script names.Tor Andersson
Drop the unused 'serif' argument to the CJK lookup functions. Use the BCP 47 names for CJK scripts and languages: zh-Hant for traditional Chinese, zh-Hans for simplified Chinese, ja for Japanese, ko for Korean. The lookup function also allows commonly used language+country codes: zh-TW and zh-HK for traditional Chinese, zh-CN for simplified Chinese.
2018-09-20Be consistent in use of #if FZ_ENABLE_...Robin Watts
Using #ifdef FZ_ENABLE_ means we build code in, even if we have defined FZ_ENABLE_WHATEVER to be 0 (as we do in config.h).
2018-09-20Bug 699798: Avoid removing page from list if page was not loaded.Sebastian Rasmussen
MuPDF may attempt to load a page but fail to do so, e.g. due to a circular page tree. When this happens the page will never be introduced into the document's list of pages. Its next and prev pointers are both NULL, but the code in fz_drop_page() falsely assumed that the prev pointer was always set. Thanks to oss-fuzz for reporting.
2018-09-19Add accessor for field text label.Tor Andersson
2018-09-19Make fz_page objects singleton.Tor Andersson
Keep a list of currently open pages for each document. Attempting to load a page that is already loaded will return the same instance again.
2018-09-19Fix warning.Tor Andersson
2018-09-19Update to OpenJPEG 2.3.0.Sebastian Rasmussen
There is a regression for 2325_-_JPX_image_with_padding_rejected.pdf. Object 3 in that document is a JPX-encoded image. Its EOC marker is preceded by two extra bytes of data, 0x80 0x80. This makes the file broken according to the JPEG 2000 specification. Acrobat Reader and the Kakadu JPX decoder accepts this file without issues, so OpenJPEG 2.1.0 added code to fix this (bug 226, commit 005e75bdc). That fix detects exactly two bytes of 0x80 0x80, a rather brittle fix. Adding more padding or changing the padding byte values is not accepted. Adding more padding is acceptable to Acrobat Reader and Kakadu. An unrelated fix for another problem has since broken OpenJPEG's support for this broken image.
2018-09-16GPROOF: Move away from unlink to remove.Robin Watts
This removes the need for unistd.h, which isn't around on VS2005. Also remove unused variable.
2018-09-13jpx: Handle ICC color profiles.Sebastian Rasmussen
2018-09-13Bug 699769: Fix bugs in upsampling code for JPX images.Sebastian Rasmussen
The upsampling code in the JPX decode attempted to guess a suitable upsampling factor. The guessed factor was wrong, causing writes of samples outside of the decoded image buffer. Simply limiting the coordinates to the image buffer would not suffice because the factor was wrong for every upsampled row of pixels. openjpeg does provide an upsampling factor, so use that instead and also take the component offsets into account when decoding components into the pixmap. Combined this resolves the issue that previously triggered ASAN. Thanks to oss-fuzz for reporting.
2018-09-13Bug 699768: Drop default colorspaces even if page transformation fails.Sebastian Rasmussen
pdf_page_transform() may throw due to a cycle in the page tree. When this happened mupdf would previously forget to drop the default colorspaces obtained, after this commit they are dropped. Thanks to oss-fuzz for reporting.
2018-09-13Make naming of effective overprint argument consistent.Sebastian Rasmussen
2018-09-13Bug 699750: Check for overprinting correctly.Sebastian Rasmussen
2018-09-12Set the profile BGR flag for non-default ICC colorspaces too.Sebastian Rasmussen
2018-09-07Bug 699743: Pop clip upon error when flushing text.Sebastian Rasmussen
Not popping causes assert to be triggered in fz_draw_end_group().
2018-09-06Bug 699723: Free alternative colorspace upon error when loading ICC colorspace.Sebastian Rasmussen
2018-09-06Fix typo in size field of ICC profile colorspace.Sebastian Rasmussen
2018-09-06Bug 699717: Pop clip even in case of error.Sebastian Rasmussen
Not popping causes assert to be triggered in fz_draw_end_group().
2018-09-05Take colorspace name from ICC profile.Sebastian Rasmussen
2018-09-05Bug 699715: Support embedded ICC color profiles in GIF.Sebastian Rasmussen
2018-09-05When decoding GIF, move pixmap into struct so it can be changed.Sebastian Rasmussen
This makes it possible to change the colorspace when encountering ICC colorspaces.
2018-09-05Bug 699702: Handle ICC profiles split into multiple APP-markers.Sebastian Rasmussen
2018-09-05Add missing fz_var declarations.Tor Andersson
2018-09-05Add fz_new_stext_page_from_annot utility function.Tor Andersson
2018-09-05Use colorspace type enum instead of magic profile names.Tor Andersson
2018-09-05mutool run: Pass script path and arguments as scriptPath and scriptArgs.Tor Andersson
2018-09-04Fix 699177: Don't clamp line width to 1 after scaling by matrix expansion.Tor Andersson
2018-09-04Check for missing filename when saving gproof.Sebastian Rasmussen
2018-09-04Fix string handling when using gproof files.Sebastian Rasmussen
2018-09-04Add -dSAFER to gs calls in gproof.Michael Vrhel
Unlikely that this could be an issue, but lets add it for safety.
2018-09-04Fix bit rot in gproof support.Michael Vrhel
2018-08-30When unrecoverable errors occur on a page, at least print them.Sebastian Rasmussen
Previously there was no visibility as to what the error was.