summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2017-11-09Bug 698353: Avoid having our API depend on DEBUG/NDEBUG.Robin Watts
Currently, our API uses static inlines for fz_lock and fz_unlock, the definitions for which depend on whether we build NDEBUG or not. This isn't ideal as it causes problems when people link a release binary with a debug lib (or vice versa). We really want to continue to use static inlines for the locking functions as used from MuPDF, as we hit them hard in the keep/drop functions. We therefore remove fz_lock/fz_unlock from the public API entirely. Accordingly, we move the fz_lock/fz_unlock static inlines into fitz-imp.h (an internal header), together with the fz_keep_.../fz_drop_... functions. We then have public fz_lock/fz_unlock functions for any external callers to use that are free of compilications. At the same time, to avoid another indirection, we change from holding the locking functions as a pointer to a struct to a struct itself.
2017-11-09Avoid mu-office-lib calling fz_lock.Robin Watts
It was only ever calling fz_lock for its own lock. This was an abuse at best, and could potentially have caused trouble with the deadlock detection code. Instead, lock the same lock, but do so using custom (static) functions.
2017-11-09Fix windows build of GL app.Robin Watts
2017-11-09Squash warning.Robin Watts
2017-11-09VS2005: Fix Freeglut build.Robin Watts
2017-11-08Bug 698460: Mudraw: Set stdout to binary on windowsRobin Watts
2017-11-08Clean up and speed up text searching.Tor Andersson
2017-11-08Be a bit paranoid.Tor Andersson
We currently don't handle errors here, but if we do in the future we don't want stale pointers lying around.
2017-11-08Select and copy structured text by lines.Tor Andersson
2017-11-08Purge some obsolete MacOS X build stuff.Tor Andersson
2017-11-08gl: Remove GLFW and reinstate FreeGLUT.Tor Andersson
GLFW doesn't build on Visual Studio 2005 anymore, and I don't have time to keep up with the changes. So, we're switching back to FreeGLUT, which is more stable. I've added the two missing features that made us switch to GLFW in the first place: input methods and system clipboard support. If MuPDF is compiled with our version of FreeGLUT, we now use these functions: * glutKeyboardExtFunc * glutSetClipboard * glutGetClipboard
2017-11-08Remove broken bidi reordering code.Tor Andersson
TODO: Implement visual to logical reordering on the fly when building the structured text line.
2017-11-08Silence warning.Tor Andersson
2017-11-08Move static inline function out of header.Tor Andersson
2017-11-08Bug 698467: Honour resolution in text extraction.Robin Watts
This affects the given character bboxes.
2017-11-08Bug 698616: Fix use after free in Page_textAsHtmlRobin Watts
2017-11-08Use fz_snprintf in preference to snprintf.Robin Watts
If nothing else, this avoids warnings on VS2005.
2017-11-08Fix TGA banded operation.Robin Watts
Also, fix mudraw messages about what types can be banded.
2017-11-08Pixmap writers for formats with alpha should handle premultiplied data.Robin Watts
Any pixmap writers that can handle data with an alpha plane should accept that data in premultiplied form, and write it out appropriately for the file format. This avoids the need to unpremultiply data in mudraw, and solves the issue we were seeing where we want the png writer to be able to cope with premultiplied data (such as for the debug blending routines) and unpremultiplied data (such as that given after mudraw has unpremultiplied the data).
2017-11-08Bug 689699: Avoid buffer overrun.Robin Watts
When cleaning a pdf file, various lists (of pdf_xref_len length) are defined early on. If we trigger a repair during the clean, this can cause pdf_xref_len to increase causing an overrun. Fix this by watching for changes in the length, and checking accesses to the list for validity. This also appears to fix bugs 698700-698703.
2017-11-08Bug 698704: Fix for overflow check failing due to 'clever' compiler.Robin Watts
Adopt Josephs suggested fix for arithmetic overflow. Thanks to Kan-Ru Chen for spotting the problem.
2017-11-08Bug 698689: Don't create a hint stream for a file with 0 pages.Robin Watts
2017-11-06Update lcms2art with the latest from lcms2 (2.9).Robin Watts
2017-11-06Expose text filtering through pdf_clean interface.Robin Watts
2017-11-06Use text state handling in pdf_filter_processor to filter text.Robin Watts
2017-11-06Extract text state handling from run pdf_processor.Robin Watts
So it can be used in the filter pdf_processor too.
2017-11-02Fixes for win32 build.Tor Andersson
2017-11-01Add separate fz_close_output step.Tor Andersson
Closing flushes output and may throw exceptions. Dropping frees the state and never throws exceptions.
2017-11-01Use int64_t for public file API offsets.Tor Andersson
Don't mess with conditional compilation with LARGEFILE -- always expose 64-bit file offsets in our public API.
2017-11-01Don't use 'long' needlessly.Tor Andersson
2017-11-01Silence warning.Tor Andersson
2017-10-30Avoid UMR in fz_copy_pixmap_area_converting_seps.Robin Watts
When mapping spots down to process colors, don't try to map disabled spots.
2017-10-25Fix multithreaded crash with tiled regions.Robin Watts
Michael has found a crash when scrolling quickly through pages with gsview. 2 Threads are redrawing at the same time from a display list. The problem comes when both threads happen to be trying to draw the same tile from the cache at the same time. The current code alters the ->{x,y} values of the pixmap from the cache as it tiles. If 2 threads are using the same tile at the same time, this causes a race condition which can upset the clipping calculations and we can access out of range. The solution is to make a new 'wrapper' fz_pixmap around the same data, and to alter the x/y values there instead. We therefore introduce a (hopefully generally useful) function fz_new_pixmap_from_pixmap, and use that.
2017-10-25Fix pgm corruption with spots files.Robin Watts
When converting from a source space to a destination space with spots for our "overprint" group push, we were hitting problems in our use of the pixmap converters. Pixmap converters with copy_spots set can assume that the source and destination spots are the same - when copy spots is NOT set, we cannot assume this. This was leading us to have uninitialised group backgrounds. I believe we were only seeing this with pgm because of the device k to cmyk as K only special case. Also fix an error in the fast_gray_to_cmyk routine that failed to account for the change from subtractive to additive.
2017-10-25Ensure that fz_new_image_from_buffer doesn't leak a colorspace.Robin Watts
2017-10-25Fix colorspace reference counting in fz_load_*_info.Tor Andersson
These are called from fz_new_image_from_buffer.
2017-10-25Clean up ICC loading in PNG loader.Tor Andersson
2017-10-25Get gprf working with the changes made to the fz_separationsMichael Vrhel
2017-10-25Have get_output_intent return ICC profile for image class documentMichael Vrhel
This is needed for gsview where I would like to know the output intent of the PDF document as well as the color space for any image documents that we open. That way users can better know how best to color manage the documents.
2017-10-25Use ICC profile in tiff file if presentMichael Vrhel
2017-10-25Add CIE Lab color space support to tiff loaderMichael Vrhel
2017-10-25Get ICC information from JPEG imageMichael Vrhel
2017-10-25Use embedded ICC profile when rendering PNG imagesMichael Vrhel
2017-10-25Add fz_new_icc_colorspace_from_stream.Robin Watts
2017-10-24Add proper handling of bgr<->rgb for pixmap conversionsMichael Vrhel
2017-10-24Add interface for setting icc space to bgr formatMichael Vrhel
This is needed so that we can have bgr formatting with something other than the default sRGB
2017-10-24Handle DeviceBGR <-> DeviceRGB properlyMichael Vrhel
2017-10-24Minor fix for bgr handling with lcms2Michael Vrhel
2017-10-24Update pixmap with spots conversion to cope with alpha.Robin Watts
2017-10-24Fix problem with spot shadings in isolated groups.Robin Watts
As seen with ../tests_private/comparefiles/Bug693541.pdf This file has an RGB isolated group, within which it renders a spot only shading. We therefore create the RGB+S+A pixmap, and set it to all zeros. The shading is drawn to a new S+A pixmap. The problem comes when the code writes the S+A pixmap to the RGB+S+A one. When we set the alpha values to be non zero in an additive space we need to reset the process components to be full (scaled by alpha).