summaryrefslogtreecommitdiff
path: root/fitz/stm_buffer.c
AgeCommit message (Collapse)Author
2013-04-26Squash 2 const warnings.Robin Watts
Add some more consts's and use void *'s where appropriate.
2013-04-11Move pdf_image to fz_image.Robin Watts
In order to be able to output images (either in the pdfwrite device or in the html conversion), we need to be able to get to the original compressed data stream (or else we're going to end up recompressing images). To do that, we need to expose all of the contents of pdf_image into fz_image, so it makes sense to just amalgamate the two. This has knock on effects for the creation of indexed colorspaces, requiring some of that logic to be moved. Also, we need to make xps use the same structures; this means pushing PNG and TIFF support into the decoding code. Also we need to be able to load just the headers from PNG/TIFF/JPEGs as xps doesn't include dimension/resolution information. Also, separate out all the fz_image stuff into fitz/res_image.c rather than having it in res_pixmap.
2013-02-06Fix SEGVs seen on unix caused by the fz_output commit.Robin Watts
It seems that gcc requires arg lists to be 'va_copy'ied, otherwise they can't be reused. This solves problems in the rework of fz_buffer_printf.
2013-02-04Add fz_output, and make output functions use it.Robin Watts
Various functions in the code output to FILE *, when there are times we'd like them to output to other things, such as fz_buffers. Add an fz_output type, together with fz_printf to allow things to output to this.
2012-11-16Add fz_write_buffer_rune to append a utf-8 character to a buffer.Tor Andersson
2012-09-21When we are growing an fz_buffer, ensure it doesn't stay 0 sized.Robin Watts
Simple tweak, was causing problems in pdf_write.
2012-07-05Merge branch 'master' into formsRobin Watts
2012-07-04Bug 693160: Fix bug in fz_write_buffer_bits.Robin Watts
When writing few enough bits that they would fit into the 'spare' bits in the last byte, I was failing to update the buffer. Also, I was failing to grow the buffer enough, and calculating the wrong number of bits left over in various places. Both fixed here. Thanks to Robert Jedrzejczyk and Sebras!
2012-06-25Fix warnings/compile error on linux.Robin Watts
min is a windows only define.
2012-06-22Fix a char vs unsigned char warning.Robin Watts
2012-06-21Add fz_buffer_cat_pdf_string function to avoid Bug 693143.Robin Watts
Avoid overflowing fz_buffer_printf by using a dedicated string output function; this also solves potential problems with us not escaping chars in strings correctly. Unfortunately this doesn't completely cure the bug as we run straight into problems in the lexer.
2012-06-20Silence signed/unsigned conversion warning.Tor Andersson
2012-06-19Avoid lots of const warnings.Robin Watts
Add/Remove a few consts to pacify MSVC.
2012-06-13Merge branch 'master' into formsPaul Gardiner
Conflicts: fitz/fitz-internal.h fitz/stm_buffer.c pdf/mupdf-internal.h
2012-06-12A few general utility functions added for the sake of the forms workPaul Gardiner
2012-06-12Forms: improved handling of text scaling in multiline text widgetsPaul Gardiner
2012-05-31A few general utility functions added for the sake of the forms workPaul Gardiner
2012-05-31Add linearization to pdf_write function.Robin Watts
Extend mupdfclean to have a new -l file that writes the file linearized. This should still be considered experimental When writing a pdf file, analyse object use, flatten resource use, reorder the objects, generate a hintstream and output with linearisaton parameters. This is enough for Acrobat to accept the file as being optimised for Fast Web View. We ought to add more tables to the hintstream in some cases, but I doubt anyone actually uses it, the spec is so badly written. Certainly acrobat accepts the file as being optimised for 'Fast Web View'. Update fz_dict_put to allow for us adding a reference to the dictionary that is the sole owner of that reference already (i.e. don't drop then keep something that has a reference count of just 1). Update pdf_load_image_stream to use the stm_buf from the xref if there is one. Update pdf_close_document to discard any stm_bufs it may be holding. Update fz_dict_put to be pdf_dict_put - this was missed in a renaming ages ago and has been inconsistent since.
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-06Split fitz.h/mupdf.h into internal/external headers.Robin Watts
Attempt to separate public API from internal functions.
2012-02-25Add fz_trim_buffer function, and call it.Robin Watts
Remove stray space at the end of buffers.
2012-02-03Be consistent about passing a fz_context argument in pixmap functions.Tor Andersson
2011-12-16Add fz_malloc_struct, and make code use it.Robin Watts
The new fz_malloc_struct(A,B) macro allocates sizeof(B) bytes using fz_malloc, and then passes the resultant pointer to Memento_label to label it with "B". This costs nothing in non-memento builds, but gives much nicer listings of leaked blocks when memento is enabled.
2011-12-15More Memsqueezing fixes.Robin Watts
2011-12-08Stylistic changes when testing pointer values for NULL.Tor Andersson
Also: use 'cannot' instead of 'failed to' in error messages.
2011-12-08Fix SEGV with "1439 - color softmask fails to draw jpx image.pdf"Robin Watts
Another missed fz_rethrow. Also, ensure that fz_drop_buffer copes with NULL input.
2011-09-21Rename malloc functions for arrays (fz_calloc and fz_realloc).Tor Andersson
2011-09-15Add context to mupdf.Robin Watts
Huge pervasive change to lots of files, adding a context for exception handling and allocation. In time we'll move more statics into there. Also fix some for(i = 0; i < function(...); i++) calls.
2011-04-04Le Roi est mort, vive le Roi!Tor Andersson
The run-together words are dead! Long live the underscores! The postscript inspired naming convention of using all run-together words has served us well, but it is now time for more readable code. In this commit I have also added the sed script, rename.sed, that I used to convert the source. Use it on your patches and application code.
2011-01-27Add fz_calloc function to check for integer overflow when allocating arrays, ↵Tor Andersson
and change the signature of fz_realloc to match.
2010-07-29Use chained reader like interface for filters instead of process interface.Tor Andersson
2010-07-26Fix bug where storage capacity of 0 or 1 was not taken care of.Sebastian Rasmussen
2010-07-17Remove all trailing whitespace.Tor Andersson
2010-07-10Refactor colorspace and PDF image parsing code.Tor Andersson
2009-12-03Consolidate include lines to a single fitz.h.Tor Andersson
2009-11-29Fix up indentation.Tor Andersson
2009-11-28The pointers were incorrectly set up after growing a buffer after changes in ↵Tor Andersson
the malloc-related patches.
2009-11-28Malloc cannot return null. Clean up in mupdf resource code.Tor Andersson
2009-11-20Malloc cannot return null. Clean up streams and filters.Tor Andersson
2009-03-11Remove fz_outofmem constant.Tor Andersson
2009-03-11Change fz_error* struct into an integer error type fz_error.Tor Andersson
2009-02-28Merge and move header files into the source directories.Tor Andersson
2009-02-28Moved Fitz files into one directory.Tor Andersson