summaryrefslogtreecommitdiff
path: root/fitz
AgeCommit message (Collapse)Author
2012-03-19Bug 692746; avoid 'double palettes' on jpx images.Robin Watts
It seems that JPX images can be supplied in indexed format, with both a palette internal to the jpx stream, and a palette in the PDF. Googling seems to suggest that the internal palette should be ignored in this case, and the external palette applied. Fortunately, since OpenJPEG-1.5 there is a flag that can be used to tell OpenJPEG not to decode palettes. We update the code here to spot that there is an external palette, and to set this flag.
2012-03-16Bug 692805: BBox rounding issuesRobin Watts
Currently all conversions from rect to bbox are done using a single function, fz_round_rect. This causes problems, as sometimes we want 'round, allowing for slight calculation errors' and sometimes we want 'round slavishly to ensure we have a bbox that covers the rect'. We therefore split these 2 cases into 2 separate functions; fz_round_rect is kept, meaning "round outwards allowing for slight errors", and fz_bbox_covering_rect is added to mean "give us the smallest bbox that is guaranteed to cover rect". No regressions seen.
2012-03-15Fix 2 regressions in xps test files due to palette change.Robin Watts
When coping with missing transparency entries, fill with 255, not 0. Simplify code slightly so we fill completely, not just to depth.
2012-03-15Bug 692911: Cope with over/undersize palette entries in pngs.Robin Watts
If entries are larger than they need to be, accept just the amount we need. If not large enough, pad out with zeros.
2012-03-14Bug 692917: Move to dynamic stroke_states.Robin Watts
Move fz_stroke_state from being a simple structure whose contents are copied repeatedly to being a dynamically allocated reference counted object so we can cope with large numbers of entries in the dash array.
2012-03-14When bounding paths, only apply miterlimit when mitering.Robin Watts
From SumatraMuPDF.patch - Many thanks.
2012-03-14Ignore trailing movetos in path bounding calculations.Robin Watts
Taken from SumatraPDF.patch - Many thanks.
2012-03-14Implement Repeat and Reflect gradients in XPS.Tor Andersson
Thanks to SumatraPDF for the patch.
2012-03-14Some fixes to the new text device, courtesy of Zeniko.Tor Andersson
2012-03-14Put 'lastchar' into the text device struct to remember what theTor Andersson
last character was across style changes.
2012-03-14Fix memory leaks in style sheet handling of the new text device.Tor Andersson
2012-03-14Use correct linejoins on font with modern enough freetype.Robin Watts
2012-03-14Fix memory leak in image_tiffRobin Watts
When we have finished replacing tiff->samples, free the old samples block. Taken from Sumatra.patch - many thanks.
2012-03-14Free doc links without recursionRobin Watts
Taken from Sumatra.patch - Many thanks.
2012-03-13Merge master and pg_android branchesRobin Watts
Bring up to date with current APIs, including text device changes.
2012-03-13Make fz_print functions all take a FILE *.Robin Watts
Also tidy up the taking of fz_context *'s, and hide an unwanted indent param.
2012-03-13Fix building on windows.Robin Watts
Fix a couple of silly problems (one gccism, and one windows specific bug).
2012-03-13Add ctx argument and rename fz_bound_pixmap to fz_pixmap_bbox.Tor Andersson
2012-03-13Rename some functions and accessors to be more consistent.Tor Andersson
Debug printing functions: debug -> print. Accessors: get noun attribute -> noun attribute. Find -> lookup when the returned value is not reference counted. pixmap_with_rect -> pixmap_with_bbox. We are reserving the word "find" to mean lookups that give ownership of objects to the caller. Lookup is used in other places where the ownership is not transferred, or simple values are returned. The rename is done by the sed script in scripts/rename3.sed
2012-03-13Split XPS header. Update Makefile dependencies. Add pixmap w/h accessors.Tor Andersson
2012-03-12Create style sheet and group extracted text into blocks, lines and spans.Tor Andersson
2012-03-12Move fz_alloc_default to internal header.Tor Andersson
2012-03-12Merge branch 'header-split'Robin Watts
2012-03-12Store AA level used to render a glyph in the glyphcache.Robin Watts
In the existing code, glyphs are stored/retrieved from the glyphcache with no reference to the antialias level used to create them. This means that if we are using different aa levels in different threads, we can retrieve 'non-matching' glyphs and hence get rendering indeterminisms. Fixed simply here by storing the aa level in the glyphcache too.
2012-03-12More API work.Robin Watts
Details of buffers hidden in fitz-internal.h. Public API now just lets us keep/drop and get storage details for a buffer. fz_debug_outline{,_xml} lose the 'level' param in their public API. fz_matrix_max_expansion hidden, as it's only used internally. Document fz_setjmp/fz_longjmp and Apple specific hackery.
2012-03-12Change order of params in fz_convert_color to C standard.Robin Watts
C's standard is copy(dst, src), so we move to adopt that here. Hopefully no one is calling this routine other than us - if they are, then I apologise! Better to aim for consistency before we freeze the API at v1.0 than to carry an inconsistent API around ever after.
2012-03-12Change order of params in fz_convert_pixmap to C standard.Robin Watts
C's standard is copy(dst, src), so we move to adopt that here. Hopefully no one is calling this routine other than us - if they are, then I apologise! Better to aim for consistency before we freeze the API at v1.0 than to carry an inconsistent API around ever after.
2012-03-12Merge branch 'master' into header-splitRobin Watts
2012-03-12Test both coordinates when checking for empty/infinite rect and bboxes.Sebastian Rasmussen
2012-03-12Clamp real numbers when parsing.Sebastian Rasmussen
Instead of returning in 1.0 for underflow/overflow, return minimum value for underflow and maximum value for overflow. NaN returns 1.0.
2012-03-12Take care of boundary conditions in ps function evaluation.Sebastian Rasmussen
Floating point numbers are now clamped, division by zero is approximated by minimum or maximum value and NaN results in 1.0.
2012-03-12More API tidying.Robin Watts
Make fz_clone_context copy existing AA settings. Add accessor function for fz_bitmap. Add more documentation for various functions/types.
2012-03-07Add more function level docs.Robin Watts
2012-03-07More release tidyups.Robin Watts
Add some function documentation to fitz.h. Add fz_ prefix to runetochar, chartorune, runelen etc. Change fz_runetochar to avoid passing unnecessary pointer.
2012-03-07Tweak Halftone functionsRobin Watts
A NULL halftone pointer passed to fz_halftone_pixmap is now taken to mean "use the default halftone". This means we can remove most of the halftone functions from the public API until (post 1.0) we decide to flesh out the functionality.
2012-03-07Splitting tweaks.Tor Andersson
2012-03-06Split fitz.h/mupdf.h into internal/external headers.Robin Watts
Attempt to separate public API from internal functions.
2012-03-06Fix memory corruptionRobin Watts
I'd foolishly removed a check in the previous commit that was needed. refs can be < 0 for static resources.
2012-03-06Fix ref counting bugs in race condition correction code.Robin Watts
When we attempt to insert a key/value pair into the store, we have to allow for the possibility that a racing thread may have already inserted an equivalent key/value. We have special code in place to handle this eventuality; if we spot an existing entry, we take the existing one in preference to our new key/value pair. This means that fz_store_item needs to take a new reference to any existing thing it finds before returning it. Currently the only store user that is exposed to this possibility is pdf_image; it spots an existing tile being returned, and was inadvertently double freeing the key.
2012-03-06Tweak compression bomb detection.Tor Andersson
2012-03-02Fix race condition in fz_render_ft_glyphRobin Watts
We were dropping the FREETYPE lock before completing the copy out of the glyph.
2012-03-01Add some more docs to fitz.hRobin Watts
Add docs for fz_store, fz_image, fz_halftones. Move fz_item definition into res_store.c as it does not need to be external. Rename fz_store_context to fz_keep_store_context to be consistent.
2012-03-01Fix incorrect handling of race condition.Robin Watts
When inserting an item into the store we check for an identically keyed item being there already (for instance a pixmap created from an image I at factor F may find that such a pixmap has already been inserted). The correct thing to do is to return the old one so we can use that in preference. The code was attempting to do this, but was returning a pointer to the fz_item rather than to the item->val. Fixed here.
2012-03-01Setjmp/longjmp exception tweaks.Robin Watts
First, fix a couple of the 'alternative formulations' of the try/catch code in the comments. Secondly, work around a Mac OS X compiler bug.
2012-03-01Remove mask entry from fz_pixmap as never used any more.Robin Watts
Also, the attempts to keep it up to date were causing race conditions in multithreading cases.
2012-02-29On MacOS/iOS use _setjmp/_longjmp rather than setjmp/longjmp.Robin Watts
On Apple OSs setjmp/longjmp also mess with the signal handlers; we don't use signals, so we don't need the slowdown this causes. CLUSTER_UNTESTED as not tested on cluster.
2012-02-29Fix typo in hash table code.Robin Watts
When detecting a clash when inserting into a hash table (which should only ever happen in multithreaded cases), we should give a warning, and return the existing item from the table. The current code doesn't do this due to a stupid typo. Fixed here. CLUSTER_UNTESTED as we don't test multithreaded operation in the cluster.
2012-02-26Move fz_obj to be pdf_obj.Robin Watts
Currently, we are in the slightly strange position of having the PDF specific object types as part of fitz. Here we pull them out into the pdf layer instead. This has been made possible by the recent changes to make the store no longer be tied to having fz_obj's as keys. Most of this work is a simple huge rename; to help customers who may have code that use such functions we have provided a sed script to do the renaming; scripts/rename2.sed. Various other small tweaks are required; the store used to have some debugging code that still required knowledge of fz_obj types - we extract that into a nicer 'type' based function pointer. Also, the type 3 font handling used to have an fz_obj pointer for type 3 resources, and therefore needed to know how to free this; this has become a void * with a function to free it.
2012-02-26Continued documentation improvements.Sebastian Rasmussen
More changes still to come.
2012-02-26Document some more functions.Sebastian Rasmussen