summaryrefslogtreecommitdiff
path: root/jbig2dec/jbig2_refinement.c
Commit message (Collapse)AuthorAgeFilesLines
* Update postal address in file headersChris Liddell2023-04-041-3/+3
|
* Update copyright to 2021Chris Liddell2021-03-151-1/+1
|
* Update copyright to 2020Chris Liddell2020-04-101-1/+1
|
* jbig2dec: Pass segment numbers as unsigned values to error callback.Sebastian Rasmussen2020-03-201-4/+4
| | | | | | | | | | | | | According to the JBIG2 specification segments numbers are 32 bit unsigned integer. Previously any segment numbers larger than INT32_MAX would be passed as negative numbers. Some parts of the decoder do not yet know, or do not have access to the currently decoded segment number, and this needs to be specially indicated. Therefore jbig2dec appropriates the unlikely segment number 0xffffffff to indicate an unknown segment number. This is a change of the public API.
* jbig2dec: Let arithmetic decoder and the underlying stream report errors.Sebastian Rasmussen2020-03-201-12/+12
| | | | | | When a called function indicates an error, the caller should print warnings. Since the arithmetic decoder now uses the normal way of reporting errors, the callers of the decoder are changed to report warnings.
* jbig2dec: Simplify jbig2_arith_decode.Robin Watts2020-02-051-20/+17
| | | | | | | | | Previously we passed in an int * to get errors back, and used the return code for 0 or 1. Now we use the return code for 0, 1 or -ve for error. This saves between 1% and 2% of gs runtime for decoding tests/pdf/Jbig2_042_06.pdf.
* Update source/header file copyright notice to 2019Chris Liddell2019-01-161-1/+1
|
* jbig2dec: Read region segment height/width/x/y as unsigned.Sebastian Rasmussen2018-07-311-1/+1
| | | | | | | The specification in 5.4.4 states that numbers are unsigned unless otherwise stated. 7.4.1.1 through 7.4.1.4 specifying the region segment height, width, x and y do not mention that these fields are signed, hence they ought to read and handled as unsigned.
* jbig2dec: Rephrase jbig2_error() messages.Sebastian Rasmussen2018-07-311-6/+6
| | | | | | | | | | | | * Do not prefix messages with "jbig2 error:", this ought to be done by the error callback itself. * Avoid using function names in messages as they mean nothing to the end user. * Avoid contractions in messages. * Try to adhere to "failed to" pattern as far as possible. * Messages start with lower case character, unless it refers to something in the specification. * Messages do not end with punctuation.
* jbig2dec: Print segment number in messages when available.Sebastian Rasmussen2018-07-161-12/+12
|
* jbig2dec: Rename variables to closely follow the specification.Sebastian Rasmussen2018-07-131-22/+22
|
* jbig2dec: Implement pixel out of field test for refinement regions too.Sebastian Rasmussen2018-07-131-1/+19
|
* jbig2dec: Detect NULL image pointer before trying to take reference.Sebastian Rasmussen2018-07-131-2/+2
| | | | Attempting to take a reference to NULL is a no-op anyway.
* jbig2dec: Rename jbig2_image_clone() to jbig2_image_reference().Sebastian Rasmussen2018-07-131-6/+6
| | | | | This more accurately explains what the function does, and mirrors jbig2_image_release() quite well.
* jbig2dec: Refinement bitmaps without images should be treated as fatal errors.Sebastian Rasmussen2018-07-131-0/+2
|
* jbig2dec: Report warnings if called functions indicate errors.Sebastian Rasmussen2018-07-131-4/+4
| | | | | The first error detected ought to be a fatal error, but when this error condition is propagated to callers, they should indicate warnings.
* jbig2dec: Convert debug messages in debug code to warnings.Sebastian Rasmussen2018-07-131-2/+2
| | | | | | This is because the debug code calls functions that write PBM images or similar, these may fail and when this happens the calling function ought to print a warning and fail itself.
* jbig2dec: Only return jbig2_error() for fatal errors/warnings.Sebastian Rasmussen2018-07-131-2/+2
| | | | | | | Only calls to jbig2_error() using fatal errors or warnings may return, no calls to jbig2_error() using informational or debug messages may return. This is preparation for jbig2_error() to always return -1 for errors/warnings.
* jbig2dec: Create jbig2_segment.h with segment declarations.Sebastian Rasmussen2018-07-131-0/+1
|
* jbig2dec: Create jbig2_refinement.h with refinement declarations.Sebastian Rasmussen2018-07-131-0/+1
|
* jbig2dec: Create jbig2_page.h with page declarations.Sebastian Rasmussen2018-07-131-0/+1
|
* jbig2dec: Rephrase error messages.Sebastian Rasmussen2018-07-131-5/+5
|
* jbig2dec: Remove unnecessary scoping.Sebastian Rasmussen2018-07-131-5/+3
|
* jbig2dec: Remove unnecessary comments, whitespace and unused code.Sebastian Rasmussen2018-07-131-10/+0
|
* jbig2dec: Improve error handling.Sebastian Rasmussen2018-04-111-13/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some functions detected errors but would not return these to the caller. These functions may now indicate errors: jbig2_arith_decode(), jbig2_image_resize() Errors detected by following functions were not always handled, but they are now handled properly: jbig2_arith_decode(), jbig2_arith_iaid_decode() jbig2_arith_int_ctx_new(), jbig2_build_huffman_table() jbig2_complete_page(), jbig2_image_compose() jbig2_decode_refinement_region(), jbig2_ctx_new() jbig2_image_resize(), jbig2_image_write_pbm() jbig2_image_write_pbm_file(), jbig2_image_write_png() jbig2_image_write_png_file(), jbig2_metadata_add() jbig2_page_add_result(), jbig2_renew() jbig2_strndup() Some functions detected errors but did not fail early enough: jbig2_decode_pattern_dict(), jbig2_decode_halftone_region() jbig2_decode_mmr_line() detected errors but did not produce suitable error messages. This has been rectified. Finally, if a subfunction indicates an error by returning an error code, the calling function will report a warning and return, indicating failure.
* Update copyright notice with new head office address.Ken Sharp2018-01-301-3/+3
| | | | | | | | | Also update copyright dates. Remove gs_cmdl.ps as we no longer use it, and remove its entry from psfiles.htm. Remove xfonts.htm as this feature (xfont support) is long, long gone.
* Bug 697531 : Tidy up unused code.Shailesh Mistry2017-02-151-14/+1
| | | | | | | | | | The first patch for this bug made the error return from jbig2_word_stream_buf_get_next_word pointless so this patch removes all the remaining redundant code. jbig2_word_stream_buf_get_next_word does not need to return any value so this is now defined as a void type and the rest of the code has been updated accordingly.
* Reindent jbig2dec source to follow gs coding style.Tor Andersson2016-04-081-451/+383
| | | | | | | | | | | | First a pass through gnu indent: indent \ -bad -nbap -nsob -br -ce -cli0 \ -npcs -ncs -i4 -di0 -psl -lp -lps -nut -l160 \ *.c *.h Followed by astyle to patch over some of the indentation bugs in gnu indent: astyle --style=kr -H -U -k3 *.c *.h
* Squash Warnings: JBig2Robin Watts2016-01-041-1/+1
| | | | | | ifdef out some used code. Make some functions static that should be.
* Bug 696052: Check that cloned image exists before proceeding further.Shailesh Mistry2015-09-221-0/+3
|
* Commit of build_consolidation branchChris Liddell2015-07-201-0/+586
Squashed into one commit (see branch for details of the evolution of the branch). This brings gpcl6 and gxps into the Ghostscript build system, and a shared set of graphics library object files for all the interpreters. Also, brings the same configuration options to the pcl and xps products as we have for Ghostscript.